File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed
src/Geolocator.Plugin.iOS Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ public Task<Position> GetPositionAsync(int timeoutMilliseconds = Timeout.Infinit
149
149
if ( UIDevice . CurrentDevice . CheckSystemVersion ( 9 , 0 ) )
150
150
{
151
151
NSArray backgroundModes = NSBundle . MainBundle . InfoDictionary [ ( NSString ) "UIBackgroundModes" ] as NSArray ;
152
- m . AllowsBackgroundLocationUpdates = backgroundModes . Contains ( ( NSString ) "Location" ) || backgroundModes . Contains ( ( NSString ) "location" ) ;
152
+ m . AllowsBackgroundLocationUpdates = backgroundModes != null && ( backgroundModes . Contains ( ( NSString ) "Location" ) || backgroundModes . Contains ( ( NSString ) "location" ) ) ;
153
153
}
154
154
155
155
// always prevent location update pausing since we're only listening for a single update.
You can’t perform that action at this time.
0 commit comments