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
|
||||
mapLayers.getLocationLayer().setLastKnownLocation(updatedLocation);
|
||||
if (location != null) {
|
||||
if (updatedLocation != null) {
|
||||
updateAutoMapViewConfiguration(updatedLocation);
|
||||
} else {
|
||||
if (mapLayers.getMapInfoLayer().getBackToLocation().isEnabled()) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue