Fix custom SV4 files crashing the game

This commit is contained in:
Gymnasiast 2018-02-03 18:48:57 +01:00
parent ecb6661370
commit ca12a4336b
1 changed files with 8 additions and 1 deletions

View File

@ -341,7 +341,14 @@ private:
std::string GetRCT1ScenarioName()
{
const scenario_index_entry * scenarioEntry = _scenarioRepository->GetByInternalName(_s4.scenario_name);
return path_get_filename(scenarioEntry->path);
if (scenarioEntry == nullptr)
{
return "";
}
else
{
return path_get_filename(scenarioEntry->path);
}
}
void InitialiseEntryMaps()