diff options
author | Julian Rex <julian.rex@mapbox.com> | 2019-07-02 10:25:17 -0400 |
---|---|---|
committer | Julian Rex <julian.rex@mapbox.com> | 2019-07-02 10:25:17 -0400 |
commit | f9a82dd7d67bcbacdbaa62a95cc9658b98279bfe (patch) | |
tree | 6e488086d0a5294d8e2604f7c0670390324add5d | |
parent | 664c50f3bd19399701bc41d4e0992407c706b9b8 (diff) | |
download | qtlocation-mapboxgl-upstream/jrex/downgrade-assert-to-warning.tar.gz |
Replace nil style URL assert with log and change return value to never return nil.upstream/jrex/downgrade-assert-to-warning
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index ea4a482ccc..dee339f4e9 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -389,8 +389,14 @@ public: } NSString *styleURLString = @(self.mbglMap.getStyle().getURL().c_str()).mgl_stringOrNilIfEmpty; - MGLAssert(styleURLString, @"Invalid style URL string %@", styleURLString); - return styleURLString ? [NSURL URLWithString:styleURLString] : nil; + + if (!styleURLString) + { + MGLLogInfo(@"Warning: Invalid style URL string %@", styleURLString); + } + + return styleURLString ? [NSURL URLWithString:styleURLString] : + [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]; } - (void)setStyleURL:(nullable NSURL *)styleURL |