From 6c20a7741e2619adf0be570225dbfc08358eec4b Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Mon, 24 Jul 2017 15:49:42 +0300 Subject: [PATCH] Fix NPE --- OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index dbb6c3cb02..bd14cffd7a 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -339,8 +339,8 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc OsmAndLocationProvider locationProvider = app.getLocationProvider(); if (!isMapLinkedToLocation()) { setMapLinkedToLocation(true); - if (locationProvider.getLastKnownLocation() != null) { - net.osmand.Location lastKnownLocation = locationProvider.getLastKnownLocation(); + net.osmand.Location lastKnownLocation = locationProvider.getLastKnownLocation(); + if (lastKnownLocation != null) { AnimateDraggingMapThread thread = mapView.getAnimatedDraggingThread(); int fZoom = mapView.getZoom() < zoom ? zoom : mapView.getZoom(); movingToMyLocation = true;