summaryrefslogtreecommitdiff
path: root/platform/darwin
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2016-11-14 16:02:16 -0800
committerJustin R. Miller <incanus@codesorcery.net>2016-11-15 11:36:04 -0800
commiteefda0d3813237d3f333c83780d481bc8a104309 (patch)
tree3263bcce3dab7619301da1487b202683118c42df /platform/darwin
parent07b311d4906623928ff225677dcd7a4d1ee34143 (diff)
downloadqtlocation-mapboxgl-eefda0d3813237d3f333c83780d481bc8a104309.tar.gz
[ios, macos] fixes #7059: raise exception for abstract sources on add (#7060)
Diffstat (limited to 'platform/darwin')
-rw-r--r--platform/darwin/src/MGLStyle.mm7
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm
index 7e67273a38..2da18bf95b 100644
--- a/platform/darwin/src/MGLStyle.mm
+++ b/platform/darwin/src/MGLStyle.mm
@@ -204,6 +204,13 @@ static NSURL *MGLStyleURL_emerald;
- (void)addSource:(MGLSource *)source
{
+ if (!source.rawSource) {
+ [NSException raise:NSInvalidArgumentException format:
+ @"The source %@ cannot be added to the style. "
+ @"Make sure the source was created as a member of a concrete subclass of MGLSource.",
+ source];
+ }
+
[source addToMapView:self.mapView];
}