diff --git a/src/openrct2/actions/FootpathRemoveAction.hpp b/src/openrct2/actions/FootpathRemoveAction.hpp index 61eaed8dbf..8e7335bf53 100644 --- a/src/openrct2/actions/FootpathRemoveAction.hpp +++ b/src/openrct2/actions/FootpathRemoveAction.hpp @@ -62,6 +62,11 @@ public: } TileElement* footpathElement = GetFootpathElement(); + if (footpathElement == nullptr) + { + return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_REMOVE_FOOTPATH_FROM_HERE); + } + res->Cost = GetRefundPrice(footpathElement); return res; @@ -90,6 +95,10 @@ public: tile_element_remove(footpathElement); footpath_update_queue_chains(); } + else + { + return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_REMOVE_FOOTPATH_FROM_HERE); + } res->Cost = GetRefundPrice(footpathElement);