diff options
author | Eimantas Vaiciunas <eimantas@walkingsmarts.com> | 2017-04-02 15:08:05 +0300 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-05-20 19:55:03 -0700 |
commit | bdb09c133555a47e6f7726944e10823aa3ec52f1 (patch) | |
tree | c391c325ad3941e8ec1bd68b788c755771aa0e6e | |
parent | b76ecfa657af4b36fe5658e0875d1fc492ed9230 (diff) | |
download | qtlocation-mapboxgl-bdb09c133555a47e6f7726944e10823aa3ec52f1.tar.gz |
Handle `nil` case when returning overlays
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index db459f6a2f..8c2b20b594 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -2414,6 +2414,8 @@ public: #pragma mark Overlays - (nullable NS_ARRAY_OF(id <MGLOverlay>) *)overlays { + if (self.annotations == nil) { return nil; } + NS_MUTABLE_ARRAY_OF(id <MGLOverlay>) *mutableOverlays = [NSMutableArray new]; [self.annotations enumerateObjectsUsingBlock:^(id<MGLAnnotation> _Nonnull annotation, NSUInteger idx, BOOL * _Nonnull stop) { |