Bugfix: Markers without photo could not be deleted (created pre v4.18.0).

Introduced in 1b33184835

Fixes #2071.
This commit is contained in:
Dennis Guse
2025-03-15 20:36:00 +01:00
parent 08a231c64f
commit 074484393e
@@ -434,7 +434,14 @@ public class ContentProviderUtils {
marker.setIcon(cursor.getString(iconIndex));
}
if (!cursor.isNull(photoUrlIndex)) {
marker.setPhotoUrl(Uri.parse(cursor.getString(photoUrlIndex)));
String photoUrl = cursor.getString(photoUrlIndex);
if (photoUrl.isEmpty()) {
// Before v4.18.0: a marker without a picture as URL ""
// TODO Data should be migrated.
marker.setPhotoUrl(null);
} else {
marker.setPhotoUrl(Uri.parse(cursor.getString(photoUrlIndex)));
}
}