diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-08-25 11:12:10 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-08-25 11:12:10 +0200 |
commit | 25c49d5e34a842ddbe0a7430c87ea46065468245 (patch) | |
tree | b73fd2640b070bd9ce168d7b83a25a46cdaed0bf | |
parent | 7617a19280d7d7c6d716ce366419db5993cc3254 (diff) |
catch some db query exceptions
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/FileUtils.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/FileUtils.java b/src/main/java/eu/siacs/conversations/utils/FileUtils.java index a13300d4..c2984111 100644 --- a/src/main/java/eu/siacs/conversations/utils/FileUtils.java +++ b/src/main/java/eu/siacs/conversations/utils/FileUtils.java @@ -104,15 +104,17 @@ public class FileUtils { }; try { - cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, - null); + cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,null); if (cursor != null && cursor.moveToFirst()) { final int column_index = cursor.getColumnIndexOrThrow(column); return cursor.getString(column_index); } + } catch(Exception e) { + return null; } finally { - if (cursor != null) + if (cursor != null) { cursor.close(); + } } return null; } |