diff --git a/geolocator_apple/ios/Classes/Handlers/LocationServiceStreamHandler.m b/geolocator_apple/ios/Classes/Handlers/LocationServiceStreamHandler.m index ac6e8ff4..208ef6ca 100644 --- a/geolocator_apple/ios/Classes/Handlers/LocationServiceStreamHandler.m +++ b/geolocator_apple/ios/Classes/Handlers/LocationServiceStreamHandler.m @@ -37,10 +37,12 @@ - (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatu dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ BOOL isEnabled = [CLLocationManager locationServicesEnabled]; dispatch_async(dispatch_get_main_queue(), ^(void) { - if (isEnabled) { - self->_eventSink([NSNumber numberWithInt:(ServiceStatus)enabled]); - } else { - self->_eventSink([NSNumber numberWithInt:(ServiceStatus)disabled]); + if (_eventSink != nil) { + if (isEnabled) { + self->_eventSink([NSNumber numberWithInt:(ServiceStatus) enabled]); + } else { + self->_eventSink([NSNumber numberWithInt:(ServiceStatus) disabled]); + } } }); });