From ca12a4336bd5122fa585205ec7d2db85f32aa878 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 3 Feb 2018 18:48:57 +0100 Subject: [PATCH] Fix custom SV4 files crashing the game --- src/openrct2/rct1/S4Importer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 4e2c7f8dda..1b8198863f 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -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()