Skip to content

Commit

Permalink
KOTORBASE: Don't deref HUD::_targetHealth when it's nullptr
Browse files Browse the repository at this point in the history
This fixes Coverity Scan issue #1399129.
  • Loading branch information
DrMcCoy committed Mar 2, 2019
1 parent f5ff1f1 commit 8579723
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/engines/kotorbase/gui/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ void HUD::updateTargetInformation(KotORBase::Object *object, float x, float y) {

_targetHealth->setMaxValue(object->getMaxHitPoints());
_targetHealth->setCurrentValue(object->getCurrentHitPoints());
}

elementY += _targetHealth->getHeight() + 1.0f;
elementY += _targetHealth->getHeight() + 1.0f;
}

if (_targetNameBackground)
_targetNameBackground->setPosition(x - 100, elementY, -100);
Expand Down

0 comments on commit 8579723

Please sign in to comment.