diff options
author | Jesse Bounds <jesse@rebounds.net> | 2017-02-20 15:06:46 -0800 |
---|---|---|
committer | Jesse Bounds <jesse@rebounds.net> | 2017-02-23 15:07:43 -0800 |
commit | c0718a863d0a915641857bc9cd4ff51cd508f222 (patch) | |
tree | 0d63485afba44e45d4dbb21492d25a36591f7089 /platform/darwin/src/MGLShapeSource.mm | |
parent | e860fa6f0a71805dafd03a1ac02980369b799f9e (diff) | |
download | qtlocation-mapboxgl-c0718a863d0a915641857bc9cd4ff51cd508f222.tar.gz |
[core, ios, macos] Return null when removing nonexistent source
Diffstat (limited to 'platform/darwin/src/MGLShapeSource.mm')
-rw-r--r-- | platform/darwin/src/MGLShapeSource.mm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/darwin/src/MGLShapeSource.mm b/platform/darwin/src/MGLShapeSource.mm index 07033d8d45..d7d26ba36d 100644 --- a/platform/darwin/src/MGLShapeSource.mm +++ b/platform/darwin/src/MGLShapeSource.mm @@ -88,8 +88,10 @@ const MGLShapeSourceOption MGLShapeSourceOptionSimplificationTolerance = @"MGLSh - (void)removeFromMapView:(MGLMapView *)mapView { auto removedSource = mapView.mbglMap->removeSource(self.identifier.UTF8String); - _pendingSource = std::move(reinterpret_cast<std::unique_ptr<mbgl::style::GeoJSONSource> &>(removedSource)); - self.rawSource = _pendingSource.get(); + if (removedSource) { + _pendingSource = std::move(reinterpret_cast<std::unique_ptr<mbgl::style::GeoJSONSource> &>(removedSource)); + self.rawSource = _pendingSource.get(); + } } - (mbgl::style::GeoJSONSource *)rawSource { |