mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-10 14:20:55 +00:00
Fixes null pointer exception if there is no lastKnownLocation
This commit is contained in:
1 parent
e95c8237b8
commit
ddcfc62f77
1 file changed
+4
-1
+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() {
|
||||
|
||||
Reference in new issue
Block a user