mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #14347: Crash when inserting a tile element without room
This commit is contained in:
parent
850e7431c3
commit
2b9a3424b0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue