From 4468c15c751bb44959b1357f35f0a112dc1391de Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:05:35 -0400 Subject: [PATCH] clipDroidOnScreen: Additional null check --- src/display3d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display3d.cpp b/src/display3d.cpp index 784c4503b3b..6ece53e1847 100644 --- a/src/display3d.cpp +++ b/src/display3d.cpp @@ -1775,7 +1775,7 @@ bool clipDroidOnScreen(DROID *psDroid, const glm::mat4 &perspectiveViewModelMatr /* Get its absolute dimensions */ // NOTE: This only takes into account body, but is "good enough" const BODY_STATS *psBStats = psDroid->getBodyStats(); - const iIMDShape * pIMD = (psBStats != nullptr) ? psBStats->pIMD->displayModel() : nullptr; + const iIMDShape * pIMD = (psBStats != nullptr && psBStats->pIMD != nullptr) ? psBStats->pIMD->displayModel() : nullptr; return clipShapeOnScreen(pIMD, perspectiveViewModelMatrix, overdrawScreenPoints); }