浏览代码

CPathfinder::addTeleportWhirlpool: check that obj isn't nullptr

ArseniyShestakov 10 年之前
父节点
当前提交
5c6633f8ad
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/CGameState.cpp

+ 1 - 1
lib/CGameState.cpp

@@ -3595,5 +3595,5 @@ bool CPathfinder::addTeleportOneWayRandom(const CGTeleport * obj) const
 
 bool CPathfinder::addTeleportWhirlpool(const CGWhirlpool * obj) const
 {
-   return allowTeleportWhirlpool && !gs->isTeleportChannelImpassable(obj->channel, hero->tempOwner);
+   return allowTeleportWhirlpool && obj && !gs->isTeleportChannelImpassable(obj->channel, hero->tempOwner);
 }