From 876b8f250288d653ebf16dc4a5c1e1641799a42c Mon Sep 17 00:00:00 2001 From: Flugente Date: Sat, 17 Feb 2018 19:23:03 +0000 Subject: [PATCH] Fix: possible crash during item transformation git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8520 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface Items.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index 10a417f7..7feabc46 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -14304,7 +14304,10 @@ void TransformFromItemDescBox( TransformInfoStruct * Transform) gpItemDescObject->TransformObject( gpItemDescSoldier, gubItemDescStatusIndex, Transform, gpItemDescPrevObject ); // Check to see if we need to manually erase the ammo button. - UINT32 uiNewClass = Item[gpItemDescObject->usItem].usItemClass; + UINT32 uiNewClass = 0; + if ( gpItemDescObject ) + uiNewClass = Item[gpItemDescObject->usItem].usItemClass; + BOOLEAN fEraseAmmoButton = FALSE; if (uiOrigClass & IC_GUN && !(uiNewClass & IC_GUN)) {