]> granicus.if.org Git - nethack/commitdiff
Fix segfault when chameleon form fails on the Rogue level
authorPasi Kallinen <paxed@alt.org>
Tue, 20 Oct 2015 14:28:16 +0000 (17:28 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 20 Oct 2015 14:28:16 +0000 (17:28 +0300)
src/mon.c

index 1ed1695a3cd6a32b58c02302b11166d74a4784c5..56b1ec155147d83334892ad9171d0fba79665895 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -3084,7 +3084,7 @@ boolean msg;      /* "The oldmon turns into a newmon!" */
             /* for the first several tries we require upper-case on
                the rogue level (after that, we take whatever we get) */
             if (tryct > 15 && Is_rogue_level(&u.uz)
-                && !isupper((uchar) mdat->mlet))
+                && mdat && !isupper((uchar) mdat->mlet))
                 mdat = 0;
             if (mdat)
                 break;