Fix NPE due to missing scenery

This commit is contained in:
MaxMallon authored and GitHub committed 2022-01-19 13:20:38 +01:00
1 parent 992ece4a4c
commit 9d29de1444
1 file changed
+1 -1
+1 -1
View File
@@ -460,7 +460,7 @@ static bool map_animation_invalidate_large_scenery(const CoordsXYZ& loc)
continue;
auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry();
if (sceneryEntry->flags & LARGE_SCENERY_FLAG_ANIMATED)
if (sceneryEntry != nullptr && sceneryEntry->flags & LARGE_SCENERY_FLAG_ANIMATED)
{
map_invalidate_tile_zoom1({ loc, loc.z, loc.z + 16 });
wasInvalidated = true;