1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Fix #14347: Crash when inserting a tile element without room

This commit is contained in:
Michael Steenbeek
2021-03-18 23:28:43 +01:00
committed by GitHub
parent 850e7431c3
commit 2b9a3424b0

View File

@@ -218,7 +218,7 @@ TileElement* tile_element_insert(const CoordsXYZ& loc, int32_t occupiedQuadrants
template<typename T> T* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants)
{
auto* element = tile_element_insert(loc, occupiedQuadrants, T::ElementType);
return element->template as<T>();
return (element != nullptr) ? element->template as<T>() : nullptr;
}
namespace GameActions