catch illegalargument exception when discovering extension from url

This commit is contained in:
Daniel Gultsch 2018-09-01 16:56:20 +02:00
parent effe52981a
commit f533e526fb
1 changed files with 6 additions and 1 deletions

View File

@ -534,7 +534,12 @@ public class FileBackend {
private String getExtensionFromUri(Uri uri) {
String[] projection = {MediaStore.MediaColumns.DATA};
String filename = null;
Cursor cursor = mXmppConnectionService.getContentResolver().query(uri, projection, null, null, null);
Cursor cursor;
try {
cursor = mXmppConnectionService.getContentResolver().query(uri, projection, null, null, null);
} catch (IllegalArgumentException e) {
cursor = null;
}
if (cursor != null) {
try {
if (cursor.moveToFirst()) {