]> granicus.if.org Git - icinga2/commitdiff
Active packages: Don't try to fix broken config packages which are not cached yet 7150/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Tue, 30 Apr 2019 10:19:35 +0000 (12:19 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Tue, 30 Apr 2019 10:19:35 +0000 (12:19 +0200)
lib/remote/apilistener.cpp

index 04eb4c804f0df543cc4330fd48420565ed449d5d..f4903e6a68557250007ed9d023de8bee18655b78 100644 (file)
@@ -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