From 78d5ab02c2ba8a3d05cf5639eb10a49c9ca14ec3 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Thu, 14 Nov 2024 01:04:32 +0300 Subject: [PATCH] fix: fatal error on pack removal when no world open --- src/logic/EngineController.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/logic/EngineController.cpp b/src/logic/EngineController.cpp index f6b58a0d..4c38fc78 100644 --- a/src/logic/EngineController.cpp +++ b/src/logic/EngineController.cpp @@ -253,14 +253,16 @@ void EngineController::reconfigPacks( bool hasIndices = false; std::stringstream ss; - for (const auto& id : packsToRemove) { - auto runtime = content->getPackRuntime(id); - if (runtime && runtime->getStats().hasSavingContent()) { - if (hasIndices) { - ss << ", "; + if (content) { + for (const auto& id : packsToRemove) { + auto runtime = content->getPackRuntime(id); + if (runtime && runtime->getStats().hasSavingContent()) { + if (hasIndices) { + ss << ", "; + } + hasIndices = true; + ss << id; } - hasIndices = true; - ss << id; } }