From b7dba612ba535362f96fe9da4079185a3aeab0c5 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 8 Jul 2020 14:12:04 +0200 Subject: [PATCH] Prevent crash --- .../main/java/androidx/paging/PagedStorage.java | 6 +++++- patches/Paging.patch | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 patches/Paging.patch diff --git a/app/src/main/java/androidx/paging/PagedStorage.java b/app/src/main/java/androidx/paging/PagedStorage.java index c644234c7e..500957ae78 100644 --- a/app/src/main/java/androidx/paging/PagedStorage.java +++ b/app/src/main/java/androidx/paging/PagedStorage.java @@ -542,7 +542,11 @@ final class PagedStorage extends AbstractList { // OK only if existing single page, and it's the last one if (!onlyEndPagePresent && !addingLastPage) { - throw new IllegalArgumentException("page introduces incorrect tiling"); + eu.faircode.email.Log.e("Insert page" + + " size=" + newPageSize + "/" + mPageSize + + " last=" + addingLastPage + " only=" + onlyEndPagePresent); + return; + //throw new IllegalArgumentException("page introduces incorrect tiling"); } if (onlyEndPagePresent) { mPageSize = newPageSize; diff --git a/patches/Paging.patch b/patches/Paging.patch new file mode 100644 index 0000000000..7cdf008ba8 --- /dev/null +++ b/patches/Paging.patch @@ -0,0 +1,17 @@ +diff --git a/app/src/main/java/androidx/paging/PagedStorage.java b/app/src/main/java/androidx/paging/PagedStorage.java +index c644234c7..500957ae7 100644 +--- a/app/src/main/java/androidx/paging/PagedStorage.java ++++ b/app/src/main/java/androidx/paging/PagedStorage.java +@@ -542,7 +542,11 @@ final class PagedStorage extends AbstractList { + + // OK only if existing single page, and it's the last one + if (!onlyEndPagePresent && !addingLastPage) { +- throw new IllegalArgumentException("page introduces incorrect tiling"); ++ eu.faircode.email.Log.e("Insert page" + ++ " size=" + newPageSize + "/" + mPageSize + ++ " last=" + addingLastPage + " only=" + onlyEndPagePresent); ++ return; ++ //throw new IllegalArgumentException("page introduces incorrect tiling"); + } + if (onlyEndPagePresent) { + mPageSize = newPageSize;