aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-08-25 11:12:10 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-08-25 11:12:10 +0200
commit25c49d5e34a842ddbe0a7430c87ea46065468245 (patch)
treeb73fd2640b070bd9ce168d7b83a25a46cdaed0bf /src/main/java/eu
parent7617a19280d7d7c6d716ce366419db5993cc3254 (diff)
catch some db query exceptions
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/FileUtils.java8
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 a13300d43..c29841112 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;
}