[core] Don't crash when removing a shape annotation whose layer was never created

This commit is contained in:
John Firebaugh
2015-10-30 14:36:07 -07:00
parent 557b8afb7c
commit a7219a77aa
2 changed files with 15 additions and 1 deletions

View File

@@ -131,7 +131,9 @@ void AnnotationManager::updateStyle(Style& style) {
}
for (const auto& layer : obsoleteShapeAnnotationLayers) {
style.removeLayer(layer);
if (style.getLayer(layer)) {
style.removeLayer(layer);
}
}
obsoleteShapeAnnotationLayers.clear();