Merge pull request #4194 from osmandapp/fix_npe_25_line

Fix NPE
This commit is contained in:
vshcherb 2017-07-24 15:18:05 +02:00 committed by GitHub
commit 6728d20a05

View file

@ -339,8 +339,8 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
OsmAndLocationProvider locationProvider = app.getLocationProvider(); OsmAndLocationProvider locationProvider = app.getLocationProvider();
if (!isMapLinkedToLocation()) { if (!isMapLinkedToLocation()) {
setMapLinkedToLocation(true); 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(); AnimateDraggingMapThread thread = mapView.getAnimatedDraggingThread();
int fZoom = mapView.getZoom() < zoom ? zoom : mapView.getZoom(); int fZoom = mapView.getZoom() < zoom ? zoom : mapView.getZoom();
movingToMyLocation = true; movingToMyLocation = true;