summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-03-27 15:46:59 +0200
committerBardur Arantsson <bardur@scientician.net>2016-03-27 15:47:19 +0200
commit5adeda8d795191c8d8741795f1961cbe070828cb (patch)
treef76417759c4626cc6ca235c92bf6c17e281972b1
parentfaae2becd29ef9fac880b9932781fc41b996459d (diff)
Fix potential NPE when hallucinating
-rw-r--r--src/monster2.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/monster2.cc b/src/monster2.cc
index 3debb27a..4649f446 100644
--- a/src/monster2.cc
+++ b/src/monster2.cc
@@ -1252,7 +1252,7 @@ void monster_desc(char *desc, monster_type *m_ptr, int mode)
{
hallu_race = &r_info[randint(max_r_idx - 2)];
}
- while (hallu_race->flags1 & RF1_UNIQUE);
+ while ((hallu_race->flags1 & RF1_UNIQUE) && (hallu_race->name != nullptr));
strcpy(silly_name, hallu_race->name);
}