diff options
author | Bardur Arantsson <bardur@scientician.net> | 2016-03-27 15:46:59 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2016-03-27 15:47:19 +0200 |
commit | 5adeda8d795191c8d8741795f1961cbe070828cb (patch) | |
tree | f76417759c4626cc6ca235c92bf6c17e281972b1 /src/monster2.cc | |
parent | faae2becd29ef9fac880b9932781fc41b996459d (diff) |
Fix potential NPE when hallucinating
Diffstat (limited to 'src/monster2.cc')
-rw-r--r-- | src/monster2.cc | 2 |
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); } |