Skip to content

Commit b73535f

Browse files
ashishkumar468Vivek Maskara
authored and
Vivek Maskara
committed
added null check before initialising LatLng after receiving location … (commons-app#1791)
* added null check before initialising LatLng after receiving location permission * flipped null==lastKL with lastKL==null
1 parent f46da66 commit b73535f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/java/fr/free/nrw/commons/location/LocationServiceManager.java

+3
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public LatLng getLKL() {
106106
if (lastKL == null) {
107107
lastKL = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
108108
}
109+
if (lastKL == null) {
110+
return null;
111+
}
109112
return LatLng.from(lastKL);
110113
} else {
111114
return null;

0 commit comments

Comments
 (0)