diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index 7e67273a3..2da18bf95 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]; }