Skip to content

Commit bd44745

Browse files
committed
Potentially fixing a store crash
1 parent 5ba9aba commit bd44745

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/src/main/java/org/thoughtcrime/securesms/mediasend/MediaRepository.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ void getPopulatedMedia(@NonNull Context context, @NonNull List<Media> media, @No
194194
long size = cursor.getLong(cursor.getColumnIndexOrThrow(Images.Media.SIZE));
195195
String filename = cursor.getString(cursor.getColumnIndexOrThrow(Images.Media.DISPLAY_NAME));
196196

197+
// skip media if the filename or mimetype is null here
198+
if (filename == null || mimetype == null) {
199+
continue;
200+
}
201+
197202
media.add(new Media(uri, filename, mimetype, date, width, height, size, bucketId, null));
198203
}
199204
}

0 commit comments

Comments
 (0)