From 7b6d245444d13b99b277373c5d61b69184768a0e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 24 Mar 2015 09:22:51 +0100 Subject: [PATCH] - added NULL pointer checks to A_CheckStaff. --- src/g_hexen/a_clericstaff.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/g_hexen/a_clericstaff.cpp b/src/g_hexen/a_clericstaff.cpp index ecce09d345..45551f55fa 100644 --- a/src/g_hexen/a_clericstaff.cpp +++ b/src/g_hexen/a_clericstaff.cpp @@ -83,7 +83,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck) { pmo->health = player->health = newLife; } - P_SetPsprite (player, ps_weapon, weapon->FindState ("Drain")); + if (weapon != NULL) + { + FState * newstate = weapon->FindState("Drain"); + if (newstate != NULL) P_SetPsprite(player, ps_weapon, newstate); + } } if (weapon != NULL) {