Selaa lähdekoodia

Fix segfault when non-hero forces win

Vadim Markovtsev 9 vuotta sitten
vanhempi
sitoutus
2a6a8cd433
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      server/CGameHandler.cpp

+ 1 - 1
server/CGameHandler.cpp

@@ -741,7 +741,7 @@ void CGameHandler::battleAfterLevelUp( const BattleResult &result )
 
 		sendAndApply(&sah);
 	}
-	if(finishingBattle->winnerHero->stacks.empty())
+	if(finishingBattle->winnerHero && finishingBattle->winnerHero->stacks.empty())
 	{
 		RemoveObject ro(finishingBattle->winnerHero->id);
 		sendAndApply(&ro);