diff --git a/src/kits/shared/Geolocation.cpp b/src/kits/shared/Geolocation.cpp index db712fb9d4..3086abbb41 100644 --- a/src/kits/shared/Geolocation.cpp +++ b/src/kits/shared/Geolocation.cpp @@ -131,8 +131,11 @@ BGeolocation::LocateSelf(float& latitude, float& longitude) double lat, lon; result = location.FindDouble("lat", &lat); - if (result == B_OK) - result = location.FindDouble("lng", &lon); + if (result != B_OK) + return result; + result = location.FindDouble("lng", &lon); + if (result != B_OK) + return result; latitude = lat; longitude = lon;