From f533e526fb0e841757d358e272d16aeab5cd015a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 1 Sep 2018 16:56:20 +0200 Subject: [PATCH] catch illegalargument exception when discovering extension from url --- .../eu/siacs/conversations/persistance/FileBackend.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index adcabc47f..630109c46 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -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()) {