diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2016-11-14 16:02:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-14 16:02:16 -0800 |
commit | f7db6cf7601e5d97492622cab76ed38ce692b37c (patch) | |
tree | 6ea8bb56ddf8903e3177c069d85ae2aa89e8323e | |
parent | dbd22357441ec66c46cc7e46a01ed114a18f685c (diff) | |
download | qtlocation-mapboxgl-f7db6cf7601e5d97492622cab76ed38ce692b37c.tar.gz |
[ios, macos] fixes #7059: raise exception for abstract sources on add (#7060)
-rw-r--r-- | platform/darwin/src/MGLStyle.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index a17b7d6b74..f1537f9496 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -206,6 +206,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]; } |