fix segfault when splatter did not have historical figure

develop
Dan Amlund 2018-01-28 13:37:27 +01:00
parent 2deeda11d2
commit 537e94d75a
1 changed files with 1 additions and 1 deletions

@ -1065,7 +1065,7 @@ df::unit *Gui::getAnyUnit(df::viewscreen *top)
{ {
// loo(k) at blood/ichor/.. spatter with a name // loo(k) at blood/ichor/.. spatter with a name
MaterialInfo mat; MaterialInfo mat;
if (mat.decode(item->spatter_mat_type, item->spatter_mat_index)) if (mat.decode(item->spatter_mat_type, item->spatter_mat_index) && mat.figure)
return df::unit::find(mat.figure->unit_id); return df::unit::find(mat.figure->unit_id);
} }
} }