1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 05:23:04 +01:00

Check for null id

This commit is contained in:
duncanspumpkin
2019-02-07 11:41:54 +00:00
parent 5e319a4a37
commit bca79da193

View File

@@ -69,7 +69,7 @@ public:
GameActionResult::Ptr Query() const override
{
if (_rideIndex >= MAX_RIDES)
if (_rideIndex >= MAX_RIDES || _rideIndex == RIDE_ID_NULL)
{
log_warning("Invalid game command for ride %u", _rideIndex);
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);