Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

widget: Don't clear stats of null pointers.

Fixes ticket:3981.
  • Loading branch information...
commit 50efcff92e58ba707cb31804d7a715a406a06b7a 1 parent c00c6f3
@Cyp Cyp authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/hci.cpp
View
6 src/hci.cpp
@@ -2406,7 +2406,7 @@ static void intObjectDied(UDWORD objID)
// clear the object button
IntObjectButton *psBut = (IntObjectButton *)widgGetFromID(psWScreen, objID);
- if (psBut->clearData())
+ if (psBut != nullptr && psBut->clearData())
{
// and its gubbins
gubbinsID = IDOBJ_FACTORYSTART + objID - IDOBJ_OBJSTART;
@@ -3569,6 +3569,10 @@ static void intSetStats(UDWORD id, BASE_STATS *psStats)
{
/* Update the button on the object screen */
IntStatusButton *statButton = (IntStatusButton *)widgGetFromID(psWScreen, id);
+ if (statButton == nullptr)
+ {
+ return;
+ }
statButton->setTip("");
WIDGET::Children children = statButton->children();
for (WIDGET::Children::const_iterator i = children.begin(); i != children.end(); ++i)
Please sign in to comment.
Something went wrong with that request. Please try again.