labormanager/#1103: fix NPE in meeting test

develop
Kelly Kinkade 2017-08-04 11:29:48 -05:00
parent 682d4b3144
commit b61859a55e
1 changed files with 4 additions and 4 deletions

@ -1220,10 +1220,10 @@ private:
{ {
df::unit* other = p1 ? act->unit_noble : act->unit_actor; df::unit* other = p1 ? act->unit_noble : act->unit_actor;
if (other && !(other->flags1.bits.dead || if (other && !(other->flags1.bits.dead ||
other->job.current_job->job_type == df::job_type::Sleep || (other->job.current_job &&
other->job.current_job->job_type == df::job_type::Rest || (other->job.current_job->job_type == df::job_type::Sleep ||
ENUM_ATTR(profession, military, other->profession))) other->job.current_job->job_type == df::job_type::Rest)) ||
{ ENUM_ATTR(profession, military, other->profession))) {
dwarf->clear_all = true; dwarf->clear_all = true;
if (print_debug) if (print_debug)
out.print("Dwarf \"%s\" has a meeting, will be cleared of all labors\n", dwarf->dwarf->name.first_name.c_str()); out.print("Dwarf \"%s\" has a meeting, will be cleared of all labors\n", dwarf->dwarf->name.first_name.c_str());