From 1c1da15c9642f735f3c3d56a716ad0e5aa0c59ed Mon Sep 17 00:00:00 2001 From: KJeff01 Date: Mon, 19 Feb 2024 17:11:06 -0600 Subject: [PATCH] Crash prevention for structureBuildDir() --- src/structure.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structure.cpp b/src/structure.cpp index e72864a14f7..450176a9da4 100644 --- a/src/structure.cpp +++ b/src/structure.cpp @@ -1500,7 +1500,7 @@ STRUCTURE *buildStructureDir(STRUCTURE_STATS *pStructureType, UDWORD x, UDWORD y psTile->psObject = psBuilding; // if it's a tall structure then flag it in the map. - if (psBuilding->sDisplay.imd->max.y > TALLOBJECT_YMAX) + if (psBuilding->sDisplay.imd && psBuilding->sDisplay.imd->max.y > TALLOBJECT_YMAX) { auxSetBlocking(tileX, tileY, AIR_BLOCKED); }