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:
Ashish Kumar 2018-08-04 21:33:57 +05:30 committed by Vivek Maskara
parent f46da6639c
commit b73535f621

View file

@ -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;