mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2025-12-15 19:03:31 +00:00
Fix NullReferenceException in windows phone 8 (#3)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013 appPlant UG
|
Copyright 2013-2014 appPlant UG
|
||||||
|
|
||||||
Licensed to the Apache Software Foundation (ASF) under one
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
or more contributor license agreements. See the NOTICE file
|
or more contributor license agreements. See the NOTICE file
|
||||||
@@ -127,7 +127,9 @@ namespace Cordova.Extension.Commands
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private static bool IsServiceAvailable()
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user