Fix NPE
This commit is contained in:
parent
0c59b0b290
commit
7ab4ae98e9
2 changed files with 2 additions and 2 deletions
|
@ -844,7 +844,7 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
||||||
|
|
||||||
// Update information
|
// Update information
|
||||||
mapLayers.getLocationLayer().setLastKnownLocation(updatedLocation);
|
mapLayers.getLocationLayer().setLastKnownLocation(updatedLocation);
|
||||||
if (location != null) {
|
if (updatedLocation != null) {
|
||||||
updateAutoMapViewConfiguration(updatedLocation);
|
updateAutoMapViewConfiguration(updatedLocation);
|
||||||
} else {
|
} else {
|
||||||
if (mapLayers.getMapInfoLayer().getBackToLocation().isEnabled()) {
|
if (mapLayers.getMapInfoLayer().getBackToLocation().isEnabled()) {
|
||||||
|
|
|
@ -242,7 +242,7 @@ public class RoutingHelper {
|
||||||
route.isCalculated()? route : null);
|
route.isCalculated()? route : null);
|
||||||
}
|
}
|
||||||
double projectDist = mode == ApplicationMode.CAR ? posTolerance : posTolerance / 2;
|
double projectDist = mode == ApplicationMode.CAR ? posTolerance : posTolerance / 2;
|
||||||
if(returnUpdatedLocation && currentLocation.distanceTo(locationProjection) < projectDist) {
|
if(returnUpdatedLocation && locationProjection != null && currentLocation.distanceTo(locationProjection) < projectDist) {
|
||||||
return locationProjection;
|
return locationProjection;
|
||||||
} else {
|
} else {
|
||||||
return currentLocation;
|
return currentLocation;
|
||||||
|
|
Loading…
Reference in a new issue