Fix crash with location provider

This commit is contained in:
Victor Shcherb 2017-10-21 19:44:49 +03:00
parent 0962f6fdc8
commit 75a9acce67

View file

@ -869,6 +869,7 @@ public class OsmAndLocationProvider implements SensorEventListener {
}
public net.osmand.Location getLastKnownLocation() {
net.osmand.Location location = this.location;
if (location != null && locationRequestsCounter == 0
&& System.currentTimeMillis() - location.getTime() > STALE_LOCATION_TIMEOUT) {
location = null;