diff options
Diffstat (limited to 'Xamarin.Forms.Maps.iOS')
-rw-r--r-- | Xamarin.Forms.Maps.iOS/MapRenderer.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Xamarin.Forms.Maps.iOS/MapRenderer.cs b/Xamarin.Forms.Maps.iOS/MapRenderer.cs index 2fac61a8..7940a575 100644 --- a/Xamarin.Forms.Maps.iOS/MapRenderer.cs +++ b/Xamarin.Forms.Maps.iOS/MapRenderer.cs @@ -198,8 +198,11 @@ namespace Xamarin.Forms.Maps.MacOS var mkMapView = (MKMapView)Control; mkMapView.RegionChanged -= MkMapViewOnRegionChanged; mkMapView.GetViewForAnnotation = null; - mkMapView.Delegate.Dispose(); - mkMapView.Delegate = null; + if (mkMapView.Delegate != null) + { + mkMapView.Delegate.Dispose(); + mkMapView.Delegate = null; + } mkMapView.RemoveFromSuperview(); #if __MOBILE__ if (FormsMaps.IsiOs9OrNewer) |