From a061289c1c84991c11759cb5f8f442e18258fbb5 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 1 Nov 2013 21:47:14 +0000 Subject: [PATCH] added null check in case typedef foudn a bug --- source/glest_game/world/unit_updater.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 0446e836..5a621aa1 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -1697,6 +1697,10 @@ void UnitUpdater::updateRepair(Unit *unit, int frameIndex) { //} Command *command= unit->getCurrCommand(); + if(command == NULL) { + throw megaglest_runtime_error("command == NULL"); + } + const RepairCommandType *rct= static_cast(command->getCommandType()); const CommandType *ct = (command != NULL ? command->getCommandType() : NULL);