From 35332e989ad6db1b31b651c240eecd4813a7f13e Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Tue, 11 Sep 2018 21:17:15 +0200 Subject: catch illegalargument exception when discovering extension from url --- src/main/java/de/pixart/messenger/persistance/FileBackend.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java index 6b35219e4..0c3028feb 100644 --- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java @@ -367,7 +367,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()) { -- cgit v1.2.3