Fix a potential segfault in getAnyUnit

See #1218
develop
lethosor 2018-05-11 10:04:10 -04:00
parent 10abece564
commit ceaa518be9
1 changed files with 3 additions and 3 deletions

@ -1032,10 +1032,10 @@ df::unit *Gui::getAnyUnit(df::viewscreen *top)
case ZonesPitInfo: // (i) zone -> (P)it
case ZonesPenInfo: // (i) zone -> pe(N)
{
if (ui_building_assign_units || ui_building_item_cursor)
return vector_get(*ui_building_assign_units, *ui_building_item_cursor);
if (!ui_building_assign_units || !ui_building_item_cursor)
return NULL;
return NULL;
return vector_get(*ui_building_assign_units, *ui_building_item_cursor);
}
case Burrows:
{