added null check in case typedef foudn a bug

This commit is contained in:
Mark Vejvoda 2013-11-01 21:47:14 +00:00
parent e3a8ee6d2f
commit a061289c1c
1 changed files with 4 additions and 0 deletions

View File

@ -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<const RepairCommandType*>(command->getCommandType());
const CommandType *ct = (command != NULL ? command->getCommandType() : NULL);