mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-18 07:45:51 -08:00
Fix server crash from out-of-bounds index when players is empty (#6048)
This commit is contained in:
@@ -677,6 +677,11 @@ void Server_Game::nextTurn()
|
||||
{
|
||||
QMutexLocker locker(&gameMutex);
|
||||
|
||||
if (players.isEmpty()) {
|
||||
qWarning() << "Server_Game::nextTurn was called while players is empty; gameId = " << gameId;
|
||||
return;
|
||||
}
|
||||
|
||||
const QList<int> keys = players.keys();
|
||||
int listPos = -1;
|
||||
if (activePlayer != -1)
|
||||
|
||||
Reference in New Issue
Block a user