diff options
Diffstat (limited to 'platform/darwin/src/MGLRasterStyleLayer.mm')
-rw-r--r-- | platform/darwin/src/MGLRasterStyleLayer.mm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLRasterStyleLayer.mm b/platform/darwin/src/MGLRasterStyleLayer.mm index b832b0ad29..49dc261be8 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.mm +++ b/platform/darwin/src/MGLRasterStyleLayer.mm @@ -50,6 +50,9 @@ - (void)removeFromMapView:(MGLMapView *)mapView { auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String); + if (!removedLayer) { + return; + } _pendingLayer = std::move(reinterpret_cast<std::unique_ptr<mbgl::style::RasterLayer> &>(removedLayer)); _rawLayer = _pendingLayer.get(); } |