From 05582b960de1800e66f220f4e7af478a3d58f60c Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Wed, 27 Sep 2023 22:26:46 +0300 Subject: [PATCH] Check for nullptr --- TileEngine/renderworld.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TileEngine/renderworld.cpp b/TileEngine/renderworld.cpp index 5258b73a..7e821bab 100644 --- a/TileEngine/renderworld.cpp +++ b/TileEngine/renderworld.cpp @@ -2166,7 +2166,10 @@ void RenderTiles(UINT32 uiFlags, INT32 iStartPointX_M, INT32 iStartPointY_M, INT if ((gGameSettings.fOptions[TOPTION_USE_LOGICAL_BODYTYPES] == TRUE) && (uiRowFlags == TILES_DYNAMIC_MERCS || uiRowFlags == TILES_DYNAMIC_HIGHMERCS || uiRowFlags == TILES_DYNAMIC_STRUCT_MERCS)) { - bt = bodyTypeDB->Find(pSoldier); + if (bodyTypeDB != NULL) + { + bt = bodyTypeDB->Find(pSoldier); + } } UINT16 * pDefaultShadeTable = pShadeTable; RECT backRect; // Actually only needed if uiFlags & TILES_DIRTY, but must be initialized with values that make sense for the comparisons.