From 18bf56d3d72d5d01aeac223f042017e839847b38 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Mon, 18 Mar 2013 21:56:15 +0000 Subject: [PATCH] - Fixed: NULL pointer dereference in DrawGem. SVN r4186 (trunk) --- src/g_shared/sbarinfo_commands.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_shared/sbarinfo_commands.cpp b/src/g_shared/sbarinfo_commands.cpp index 25ea27283..81609865a 100644 --- a/src/g_shared/sbarinfo_commands.cpp +++ b/src/g_shared/sbarinfo_commands.cpp @@ -3046,7 +3046,7 @@ class CommandDrawGem : public SBarInfoCommand } void Tick(const SBarInfoMainBlock *block, const DSBarInfo *statusBar, bool hudChanged) { - goalValue = armor ? statusBar->armor->Amount : statusBar->CPlayer->mo->health; + goalValue = armor ? (statusBar->armor ? statusBar->armor->Amount : 0) : statusBar->CPlayer->mo->health; int max = armor ? 100 : statusBar->CPlayer->mo->GetMaxHealth() + statusBar->CPlayer->mo->stamina; if(max != 0 && goalValue > 0) {