mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
[ServerGame] null check participant in getPlayer (#6493)
This commit is contained in:
parent
2d5e8deb75
commit
731c487ccb
1 changed files with 1 additions and 1 deletions
|
|
@ -232,7 +232,7 @@ QMap<int, Server_AbstractPlayer *> Server_Game::getPlayers() const // copies poi
|
|||
Server_AbstractPlayer *Server_Game::getPlayer(int id) const
|
||||
{
|
||||
auto *participant = participants.value(id);
|
||||
if (!participant->isSpectator()) {
|
||||
if (participant && !participant->isSpectator()) {
|
||||
return static_cast<Server_AbstractPlayer *>(participant);
|
||||
} else {
|
||||
return nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue