kopia lustrzana https://github.com/ryukoposting/Signal-Android
Guard against devices not supporting mandatory ContentProvider columns.
The docs specify that this column is supposed to be present, but a crash says it wasn't, so alas, here in goes the check.fork-5.53.8
rodzic
c4d1bdc44d
commit
33daa21ad9
|
@ -267,7 +267,7 @@ class MediaRepository {
|
||||||
|
|
||||||
if (size <= 0) {
|
if (size <= 0) {
|
||||||
try (Cursor cursor = context.getContentResolver().query(media.getUri(), null, null, null, null)) {
|
try (Cursor cursor = context.getContentResolver().query(media.getUri(), null, null, null, null)) {
|
||||||
if (cursor != null && cursor.moveToFirst()) {
|
if (cursor != null && cursor.moveToFirst() && cursor.getColumnIndex(OpenableColumns.SIZE) >= 0) {
|
||||||
size = cursor.getLong(cursor.getColumnIndexOrThrow(OpenableColumns.SIZE));
|
size = cursor.getLong(cursor.getColumnIndexOrThrow(OpenableColumns.SIZE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue