From 502c43fb12678d6eae01583db32e3291279e6d35 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 30 Apr 2019 12:19:35 +0200 Subject: [PATCH] Active packages: Don't try to fix broken config packages which are not cached yet --- lib/remote/apilistener.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index 04eb4c804..f4903e6a6 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -1578,7 +1578,12 @@ void ApiListener::CheckApiPackageIntegrity() activeStage = ConfigPackageUtility::GetActiveStageFromFile(package); } catch (const std::exception& ex) { /* An error means that the stage is broken, try to repair it. */ - String activeStageCached = m_ActivePackageStages[package]; + auto it = m_ActivePackageStages.find(package); + + if (it == m_ActivePackageStages.end()) + continue; + + String activeStageCached = it->second; Log(LogInformation, "ApiListener") << "Repairing broken API config package '" << package -- 2.40.0