mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Fix server crash from out-of-bounds index when players is empty (#6048)
This commit is contained in:
parent
ae47ee802b
commit
4a2a646943
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue