浏览代码

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

Null pointers should not be dereferenced
Alexander Wilms 2 年之前
父节点
当前提交
cc8cc11da3
共有 1 个文件被更改,包括 1 次插入1 次删除
  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;