aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-06-16 22:34:41 +0200
committerChristian Schneppe <christian@pix-art.de>2018-06-16 22:34:41 +0200
commitfbe62a153ffed4dae226d46c68a5ee09d8e38ba6 (patch)
treeced94661ba293afe8cc274eaabad2fb3ee95d7fc /src/main
parentb96e61f904fb54222438a80971d7f031c562d457 (diff)
catch OOM in FileObserver
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/utils/ConversationsFileObserver.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/ConversationsFileObserver.java b/src/main/java/de/pixart/messenger/utils/ConversationsFileObserver.java
index 34110d7fd..72a01a13c 100644
--- a/src/main/java/de/pixart/messenger/utils/ConversationsFileObserver.java
+++ b/src/main/java/de/pixart/messenger/utils/ConversationsFileObserver.java
@@ -31,7 +31,12 @@ public abstract class ConversationsFileObserver {
String parent = stack.pop();
mObservers.add(new SingleFileObserver(parent, FileObserver.DELETE | FileObserver.MOVED_FROM));
final File path = new File(parent);
- final File[] files = path.listFiles();
+ File[] files = new File[0];
+ try {
+ files = path.listFiles();
+ } catch (OutOfMemoryError e) {
+ e.printStackTrace();
+ }
if (files == null) {
continue;
}