diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 68bccfaf6..d6cdbe0e2 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -2223,12 +2223,12 @@ bool CGameHandler::arrangeStacks(ObjectInstanceID id1, ObjectInstanceID id2, ui8 bool CGameHandler::hasPlayerAt(PlayerColor player, std::shared_ptr c) const { - return connections.at(player).count(c); + return connections.count(player) && connections.at(player).count(c); } bool CGameHandler::hasBothPlayersAtSameConnection(PlayerColor left, PlayerColor right) const { - return connections.at(left) == connections.at(right); + return connections.count(left) && connections.count(right) && connections.at(left) == connections.at(right); } bool CGameHandler::disbandCreature(ObjectInstanceID id, SlotID pos)