summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLRasterSource.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLRasterSource.mm')
-rw-r--r--platform/darwin/src/MGLRasterSource.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLRasterSource.mm b/platform/darwin/src/MGLRasterSource.mm
index 53caae5af9..62472050e3 100644
--- a/platform/darwin/src/MGLRasterSource.mm
+++ b/platform/darwin/src/MGLRasterSource.mm
@@ -62,6 +62,12 @@
- (void)addToMapView:(MGLMapView *)mapView
{
+ if (_pendingSource == nullptr) {
+ [NSException raise:@"MGLRedundantSourceException"
+ format:@"This instance %@ was already added to %@. Adding the same source instance " \
+ "to the style more than once is invalid.", self, mapView.style];
+ }
+
mapView.mbglMap->addSource(std::move(_pendingSource));
}