kits/Geolocation Fix PVS404

*	Prevent use of uninitialized 'lon' by checking for successful
		result prior call

Change-Id: Ifbd649a8c0c0c37f285cda11e307013929cefa12
Reviewed-on: https://review.haiku-os.org/c/958
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Rob Gill 2019-01-28 13:11:50 +10:00 committed by Jérôme Duval
parent 187bbba6af
commit df9641c548

View File

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