Fixes null pointer exception if there is no lastKnownLocation

This commit is contained in:
Jan Broß committed 2015-06-24 11:54:37 +02:00
1 parent e95c8237b8
commit ddcfc62f77
1 file changed
+4 -1
@@ -190,7 +190,10 @@ public class BuoyFragment extends BaseFragment implements LocationListener {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, GPS_MIN_TIME, GPS_MIN_DISTANCE, this);
Location initialLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
onLocationChanged(initialLocation);
if (initialLocation != null) {
onLocationChanged(initialLocation);
}
}
public void updateMap() {