From a7219a77aaa4a0c60d7604c32cebfb017cde271a Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 30 Oct 2015 14:36:07 -0700 Subject: [core] Don't crash when removing a shape annotation whose layer was never created --- src/mbgl/annotation/annotation_manager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mbgl/annotation/annotation_manager.cpp b/src/mbgl/annotation/annotation_manager.cpp index e82dbfe48a..dd25792676 100644 --- a/src/mbgl/annotation/annotation_manager.cpp +++ b/src/mbgl/annotation/annotation_manager.cpp @@ -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(); -- cgit v1.2.1