Просмотр исходного кода

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

ArseniyShestakov 10 лет назад
Родитель
Сommit
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);
 }