Protect against nullptr

This commit is contained in:
Ted John committed 2019-07-29 19:18:16 +01:00
1 parent 749b07e83f
commit 300ce9727e
1 file changed
+4 -1
+4 -1
View File
@@ -7936,7 +7936,10 @@ size_t Ride::FormatNameTo(void* argsV) const
if (rideEntry != nullptr)
{
auto rideGroup = RideGroupManager::GetRideGroup(type, rideEntry);
rideTypeName = rideGroup->Naming.name;
if (rideGroup != nullptr)
{
rideTypeName = rideGroup->Naming.name;
}
}
}
set_format_arg_on(args, 0, rct_string_id, 1);