mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Merge pull request #59 from misaochan/null-location-fix
Added null check for onLocationChanged()
This commit is contained in:
commit
1678c20350
1 changed files with 3 additions and 1 deletions
|
|
@ -46,7 +46,9 @@ public class GPSExtractor {
|
|||
|
||||
locationManager.requestLocationUpdates(provider, 400, 1, myLocationListener);
|
||||
Location location = locationManager.getLastKnownLocation(provider);
|
||||
myLocationListener.onLocationChanged(location);
|
||||
if (location != null) {
|
||||
myLocationListener.onLocationChanged(location);
|
||||
}
|
||||
}
|
||||
|
||||
protected void unregisterLocationManager() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue