From bff14dafdedfe5b6bd9380c6202cabce8f386e20 Mon Sep 17 00:00:00 2001 From: Jason Whitmore Date: Tue, 28 May 2024 18:09:35 -0700 Subject: [PATCH] LocationPickerActivity.java: add null check to method The original method did not include a null check for the input GeoPoint. This change includes a null check. If the input Geopoint is null, the method will simply return. --- .../nrw/commons/LocationPicker/LocationPickerActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/fr/free/nrw/commons/LocationPicker/LocationPickerActivity.java b/app/src/main/java/fr/free/nrw/commons/LocationPicker/LocationPickerActivity.java index 434f6574e..c110ba646 100644 --- a/app/src/main/java/fr/free/nrw/commons/LocationPicker/LocationPickerActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/LocationPicker/LocationPickerActivity.java @@ -267,7 +267,9 @@ public class LocationPickerActivity extends BaseActivity implements * @param point The GeoPoint object which contains the coordinates to move to */ private void moveMapTo(GeoPoint point){ - moveMapTo(point.getLatitude(), point.getLongitude()); + if(point != null){ + moveMapTo(point.getLatitude(), point.getLongitude()); + } } /**