Skip to content

Commit

Permalink
droidUpdate: Add null check
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Aug 27, 2024
1 parent 347b7d0 commit a19a79f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/droid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ void droidUpdate(DROID *psDroid)

if (psDroid->animationEvent != ANIM_EVENT_NONE)
{
iIMDBaseShape *baseImd = psDroid->sDisplay.imd->displayModel()->objanimpie[psDroid->animationEvent];
iIMDBaseShape *baseImd = (psDroid->sDisplay.imd) ? psDroid->sDisplay.imd->displayModel()->objanimpie[psDroid->animationEvent] : nullptr;
iIMDShape *imd = (baseImd) ? baseImd->displayModel() : nullptr;
if (imd && imd->objanimcycles > 0 && gameTime > psDroid->timeAnimationStarted + imd->objanimtime * imd->objanimcycles)
{
Expand Down

0 comments on commit a19a79f

Please sign in to comment.