From 36756fbd410d72e64b2e579eb383befaa806a407 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 26 Mar 2022 08:25:45 +0100 Subject: [PATCH] catch two rare exceptions to fix crash --- .../eu/siacs/conversations/persistance/FileBackend.java | 2 +- .../siacs/conversations/services/MessageArchiveService.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 404f521f4..821899eb7 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -722,7 +722,7 @@ public class FileBackend { if (cursor != null && cursor.moveToFirst()) { filename = cursor.getString(0); } - } catch (final SecurityException | IllegalArgumentException e) { + } catch (final Exception e) { filename = null; } if (filename == null) { diff --git a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java index b382022b9..79cad9520 100644 --- a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java +++ b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java @@ -256,7 +256,11 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { //do nothing } else { Log.d(Config.LOGTAG, a.getJid().asBareJid().toString() + ": error executing mam: " + p.toString()); - finalizeQuery(query, true); + try { + finalizeQuery(query, true); + } catch (final IllegalStateException e) { + //ignored + } } }); } else {