From b8cbcfe9866e75bbb7f8ea6bca0ded5850da451c Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Mon, 5 Apr 2021 15:52:30 -0400 Subject: [PATCH] Prevent crash when reading cursor in DirectoryHelper. The cause of the crash is very unclear. Our best guess at present is that the cursor is unable to fit a single row within the 2mb allocation window, and therefore can't read anything. In this case, the best we can do is catch the exception and develop some future fallback. Logging the exception will also mean that maybe we'll be able to get the actual exception message. --- .../thoughtcrime/securesms/contacts/sync/DirectoryHelper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/contacts/sync/DirectoryHelper.java b/app/src/main/java/org/thoughtcrime/securesms/contacts/sync/DirectoryHelper.java index e8f97ce6d5..b8cdfa8d4d 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/contacts/sync/DirectoryHelper.java +++ b/app/src/main/java/org/thoughtcrime/securesms/contacts/sync/DirectoryHelper.java @@ -378,7 +378,8 @@ public class DirectoryHelper { contactHolder.commit(handle); } - + } catch (IllegalStateException e) { + Log.w(TAG, "Hit an issue with the cursor while reading!", e); } finally { handle.finish(); }