From eefda0d3813237d3f333c83780d481bc8a104309 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Mon, 14 Nov 2016 16:02:16 -0800 Subject: [PATCH] [ios, macos] fixes #7059: raise exception for abstract sources on add (#7060) --- platform/darwin/src/MGLStyle.mm | 7 +++++++ 1 file changed, 7 insertions(+) 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]; }