manipulator: avoid NULL deref with unassigned job in unit list

develop
jj 2012-09-29 01:38:32 +02:00
parent 44a74ddc38
commit 12f5e6028c
1 changed files with 5 additions and 1 deletions

@ -383,8 +383,12 @@ viewscreen_unitlaborsst::viewscreen_unitlaborsst(vector<df::unit*> &src, int cur
for (size_t i = 0; i < src.size(); i++)
{
UnitInfo *cur = new UnitInfo;
df::unit *unit = src[i];
if (!unit)
continue;
UnitInfo *cur = new UnitInfo;
cur->unit = unit;
cur->allowEdit = true;
cur->active_index = active_idx[unit];