]> git.mxchange.org Git - simgear.git/commitdiff
Guard against disabling a not-yet-active catalog.
authorJames Turner <zakalawe@mac.com>
Wed, 30 Mar 2016 16:09:33 +0000 (17:09 +0100)
committerJames Turner <zakalawe@mac.com>
Wed, 30 Mar 2016 16:09:51 +0000 (17:09 +0100)
simgear/package/Root.cxx

index 7f2e8ea80560bcbd576ee71b1742956151596324..c158dbdd3d6188ffae7ad7bfc1abaee633c55732 100644 (file)
@@ -532,8 +532,10 @@ void Root::catalogRefreshStatus(CatalogRef aCat, Delegate::StatusCode aReason)
         }
 
         // and remove it from the active collection
-        d->catalogs.erase(catIt);
-    }
+        if (catIt != d->catalogs.end()) {
+            d->catalogs.erase(catIt);
+        }
+    } // of catalog has errors case
 
     if (d->refreshing.empty()) {
         d->fireRefreshStatus(CatalogRef(), Delegate::STATUS_REFRESHED);