forked from upstream-mirrors/OpenTracks
Bugfix: Markers without photo could not be deleted (created pre v4.18.0).
Introduced in 1b33184835
Fixes #2071.
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user