Prevent a dereference of nullptr

This commit is contained in:
duncanspumpkin 2019-02-26 13:02:29 +00:00
parent d3c0a76259
commit 584c4d5134

View file

@ -2433,8 +2433,8 @@ void footpath_update_path_wide_flags(int32_t x, int32_t y)
bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position)
{
auto pathElement = map_get_path_element_at(position.x, position.y, position.z)->AsPath();
return pathElement != nullptr && pathElement->IsBlockedByVehicle();
auto pathElement = map_get_path_element_at(position.x, position.y, position.z);
return pathElement != nullptr && pathElement->AsPath()->IsBlockedByVehicle();
}
/**