summaryrefslogtreecommitdiff
path: root/platform/darwin
diff options
context:
space:
mode:
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];
}