diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 198427a4e6..5b09233c4a 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -844,7 +844,7 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe // Update information mapLayers.getLocationLayer().setLastKnownLocation(updatedLocation); - if (location != null) { + if (updatedLocation != null) { updateAutoMapViewConfiguration(updatedLocation); } else { if (mapLayers.getMapInfoLayer().getBackToLocation().isEnabled()) { diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 8b83ca2c49..13aef334f6 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -242,7 +242,7 @@ public class RoutingHelper { route.isCalculated()? route : null); } double projectDist = mode == ApplicationMode.CAR ? posTolerance : posTolerance / 2; - if(returnUpdatedLocation && currentLocation.distanceTo(locationProjection) < projectDist) { + if(returnUpdatedLocation && locationProjection != null && currentLocation.distanceTo(locationProjection) < projectDist) { return locationProjection; } else { return currentLocation;