From 7b1bc9dcbdd9020bd8bdc018ed276bd711440de2 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 6 Apr 2020 18:09:47 +0300 Subject: [PATCH] Prevent segfault when not wielding anything --- src/insight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/insight.c b/src/insight.c index 1bd5a2e17..9149ceece 100644 --- a/src/insight.c +++ b/src/insight.c @@ -1077,7 +1077,7 @@ int final; * Skill with current weapon. Might help players who've never * noticed #enhance or decided that it was pointless. */ - if ((wtype = weapon_type(uwep)) != P_NONE && !is_ammo(uwep)) { + if (uwep && (wtype = weapon_type(uwep)) != P_NONE && !is_ammo(uwep)) { char sklvlbuf[20]; int sklvl = P_SKILL(wtype); boolean hav = (sklvl != P_UNSKILLED && sklvl != P_SKILLED);