StationsActivity: Fix NullPointerException in handleIntent().

This commit is contained in:
Andreas Schildbach 2018-11-26 17:37:14 +01:00
parent a4fba695a4
commit 5170775169

View file

@ -594,7 +594,7 @@ public class StationsActivity extends OeffiMainActivity implements StationsAware
final Location[] locations = LocationUriParser.parseLocations(intentUri.toString());
fixedLocation = locations != null && locations.length >= 1 ? locations[0] : null;
if (fixedLocation != null) {
if (fixedLocation != null && fixedLocation.hasCoord())
mapView.animateToLocation(fixedLocation.getLatAsDouble(), fixedLocation.getLonAsDouble());
findViewById(R.id.stations_location_clear).setOnClickListener(new OnClickListener() {
@ -631,7 +631,6 @@ public class StationsActivity extends OeffiMainActivity implements StationsAware
handler.post(initStationsRunnable);
}
}
final String query = intent.getStringExtra(SearchManager.QUERY);