summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-01-14 15:37:37 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-01-14 16:48:16 -0800
commit714dfab8aeb04b3569f022e7c22aac9a6435752d (patch)
treed4c50c09c080bbd75b830fe6431d05937d264d40
parentb52b634e5bc0d257c54bdc04057c1ce8b9ce4b76 (diff)
downloadqtlocation-mapboxgl-714dfab8aeb04b3569f022e7c22aac9a6435752d.tar.gz
[osx] Fixed static analyzer warnings
-rw-r--r--include/mbgl/osx/MGLMapView.h2
-rw-r--r--platform/osx/src/MGLMapView.mm2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/mbgl/osx/MGLMapView.h b/include/mbgl/osx/MGLMapView.h
index 7c7bea74aa..df4b597847 100644
--- a/include/mbgl/osx/MGLMapView.h
+++ b/include/mbgl/osx/MGLMapView.h
@@ -442,7 +442,7 @@ IB_DESIGNABLE
/** Deselects an annotation and hides its callout popover.
@param annotation The annotation object to deselect. */
-- (void)deselectAnnotation:(id <MGLAnnotation>)annotation;
+- (void)deselectAnnotation:(nullable id <MGLAnnotation>)annotation;
/** A common view controller for managing a callout popover’s content view.
diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm
index 505adb20a3..57df0af6a0 100644
--- a/platform/osx/src/MGLMapView.mm
+++ b/platform/osx/src/MGLMapView.mm
@@ -1929,7 +1929,7 @@ public:
- (void)popoverDidShow:(__unused NSNotification *)notification {
id <MGLAnnotation> annotation = self.selectedAnnotation;
- if ([self.delegate respondsToSelector:@selector(mapView:didSelectAnnotation:)]) {
+ if (annotation && [self.delegate respondsToSelector:@selector(mapView:didSelectAnnotation:)]) {
[self.delegate mapView:self didSelectAnnotation:annotation];
}
}