mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Fix #4437: Crash in Network::Server_Handle_AUTH
This commit is contained in:
committed by
Ted John
parent
b90f27a971
commit
6a86f007f3
@@ -670,7 +670,13 @@ uint8 Network::GetGroupIDByHash(const std::string &keyhash)
|
||||
|
||||
uint8 groupId = GetDefaultGroup();
|
||||
if (networkUser != nullptr && networkUser->GroupId.HasValue()) {
|
||||
groupId = networkUser->GroupId.GetValue();
|
||||
const uint8 assignedGroup = networkUser->GroupId.GetValue();
|
||||
if (GetGroupByID(assignedGroup) != nullptr) {
|
||||
groupId = assignedGroup;
|
||||
} else {
|
||||
log_warning("User %s is assigned to non-existent group %u. Assigning to default group (%u)",
|
||||
keyhash.c_str(), assignedGroup, groupId);
|
||||
}
|
||||
}
|
||||
return groupId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user