Browse Source

server/battles/BattleFlowProcessor.cpp: Called C++ object pointer is null

Null pointers should not be dereferenced
Alexander Wilms 2 years ago
parent
commit
cc8cc11da3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      server/battles/BattleFlowProcessor.cpp

+ 1 - 1
server/battles/BattleFlowProcessor.cpp

@@ -284,7 +284,7 @@ const CStack * BattleFlowProcessor::getNextStack(const CBattleInfoCallback & bat
 			gameHandler->sendAndApply(&bte);
 	}
 
-	if(!next->willMove())
+	if(!next || !next->willMove())
 		return nullptr;
 
 	return stack;