diff options
author | Julian Rex <julian.rex@mapbox.com> | 2019-10-05 13:06:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-05 13:06:28 -0400 |
commit | a90e5f6e97232e9e42ee86df9b07365223528b91 (patch) | |
tree | 6226b72e7fef7f6050499f872dbf3cb4253025ea /platform/darwin/src/MGLVectorTileSource.mm | |
parent | 5c565a5e51be8379ddc2ffb5c859d8cfebe2fcd5 (diff) | |
download | qtlocation-mapboxgl-a90e5f6e97232e9e42ee86df9b07365223528b91.tar.gz |
[ios, macos] Changed exception to assert and nil return, since attribution methods can be called via user interaction (without a mechanism to try/catch) (#15764)
Diffstat (limited to 'platform/darwin/src/MGLVectorTileSource.mm')
-rw-r--r-- | platform/darwin/src/MGLVectorTileSource.mm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLVectorTileSource.mm b/platform/darwin/src/MGLVectorTileSource.mm index 85270c4a49..9ab11e2e56 100644 --- a/platform/darwin/src/MGLVectorTileSource.mm +++ b/platform/darwin/src/MGLVectorTileSource.mm @@ -1,6 +1,7 @@ #import "MGLVectorTileSource_Private.h" #import "MGLFeature_Private.h" +#import "MGLLoggingConfiguration_Private.h" #import "MGLSource_Private.h" #import "MGLTileSource_Private.h" #import "MGLStyle_Private.h" @@ -44,7 +45,11 @@ } - (NSString *)attributionHTMLString { - MGLAssertStyleSourceIsValid(); + if (!self.rawSource) { + MGLAssert(0, @"Source with identifier `%@` was invalidated after a style change", self.identifier); + return nil; + } + auto attribution = self.rawSource->getAttribution(); return attribution ? @(attribution->c_str()) : nil; } |