From: Michael Friedrich Date: Tue, 30 Apr 2019 10:19:35 +0000 (+0200) Subject: Active packages: Don't try to fix broken config packages which are not cached yet X-Git-Tag: v2.11.0-rc1~119^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=502c43fb12678d6eae01583db32e3291279e6d35;p=icinga2 Active packages: Don't try to fix broken config packages which are not cached yet --- 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