mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
added null check before initialising LatLng after receiving location … (#1791)
* added null check before initialising LatLng after receiving location permission * flipped null==lastKL with lastKL==null
This commit is contained in:
parent
f46da6639c
commit
b73535f621
1 changed files with 3 additions and 0 deletions
|
|
@ -106,6 +106,9 @@ public class LocationServiceManager implements LocationListener {
|
|||
if (lastKL == null) {
|
||||
lastKL = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
|
||||
}
|
||||
if (lastKL == null) {
|
||||
return null;
|
||||
}
|
||||
return LatLng.from(lastKL);
|
||||
} else {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue