diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-09-11 21:17:15 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-09-11 21:17:15 +0200 |
commit | 35332e989ad6db1b31b651c240eecd4813a7f13e (patch) | |
tree | 6bb4acf27670d5c1690e7007a86d4aa5cc62afb8 /src/main/java/de | |
parent | e53542b63abba1d672c7678e8016e0abdce6d171 (diff) |
catch illegalargument exception when discovering extension from url
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/pixart/messenger/persistance/FileBackend.java | 7 |
1 files changed, 6 insertions, 1 deletions
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()) { |