summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLAnnotationView.mm
diff options
context:
space:
mode:
authorFabian Guerra Soto <fabian.guerra@mapbox.com>2017-03-10 14:49:22 -0800
committerGitHub <noreply@github.com>2017-03-10 14:49:22 -0800
commitffce46cae6cdc3a4b952a0aeca80b5d5f7304b6d (patch)
tree706d4746e4c791a1dde73d309606237b54ab4f31 /platform/ios/src/MGLAnnotationView.mm
parent6c6e895b23a434ca0abaad2a92c4b19ea4fd3976 (diff)
downloadqtlocation-mapboxgl-ffce46cae6cdc3a4b952a0aeca80b5d5f7304b6d.tar.gz
Raise exception when MGLAnnotationView.annotation property is nil (#8339)
* [ios] MGLAnnotationView annotation property made writable * [ios] standarized exception name for annotations
Diffstat (limited to 'platform/ios/src/MGLAnnotationView.mm')
-rw-r--r--platform/ios/src/MGLAnnotationView.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/ios/src/MGLAnnotationView.mm b/platform/ios/src/MGLAnnotationView.mm
index 0e904779d5..5e0ae3b848 100644
--- a/platform/ios/src/MGLAnnotationView.mm
+++ b/platform/ios/src/MGLAnnotationView.mm
@@ -239,7 +239,10 @@
}
else if (dragState == MGLAnnotationViewDragStateCanceling)
{
- NSAssert(self.annotation, @"Annotation property should not be nil.");
+ if (!self.annotation) {
+ [NSException raise:NSInvalidArgumentException
+ format:@"Annotation property should not be nil."];
+ }
self.panGestureRecognizer.enabled = NO;
self.longPressRecognizer.enabled = NO;
self.center = [self.mapView convertCoordinate:self.annotation.coordinate toPointToView:self.mapView];