bug 2674 fix null-ptr deref

This commit is contained in:
Enno Rehling 2020-06-27 14:27:38 +02:00
parent 40493bdc64
commit 0ea9717b5a
1 changed files with 1 additions and 1 deletions

View File

@ -83,8 +83,8 @@ static void chaos(region * r, faction *monsters)
case 0: /* Untote */
if (!(r->terrain->flags & SEA_REGION)) {
unit *u = random_unit(r);
faction * f = u->faction;
if (u && !undeadrace(u_race(u))) {
faction * f = u->faction;
if (join_monsters(u, monsters)) {
ADDMSG(&f->msgs, msg_message("chaos_disease", "unit", u));
u_setrace(u, get_race(RC_GHOUL));