mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-12-23 13:57:35 +00:00
Fix NullReferenceException in windows phone 8 (#3)
This commit is contained in:
parent
7d193b9330
commit
1e12ae1884
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2013 appPlant UG
|
||||
Copyright 2013-2014 appPlant UG
|
||||
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
@ -127,7 +127,9 @@ namespace Cordova.Extension.Commands
|
||||
/// </summary>
|
||||
private static bool IsServiceAvailable()
|
||||
{
|
||||
return !(Geolocator.LocationStatus == PositionStatus.Disabled || Geolocator.LocationStatus == PositionStatus.NotAvailable);
|
||||
Geolocator geolocator = (Geolocator == null) ? new Geolocator() : Geolocator;
|
||||
|
||||
return !(geolocator.LocationStatus == PositionStatus.Disabled || geolocator.LocationStatus == PositionStatus.NotAvailable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user