From c8e5f60c0ab746ff0b1bc815c92d9a2851fcec97 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Mon, 17 Jun 2024 21:21:37 -0400 Subject: Try fixing retrofit2.Utils.methodError in PostPagingSource when loading anonymous front page. --- .../ml/docilealligator/infinityforreddit/post/PostPagingSource.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java index 7c256d59..7b0930ec 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java @@ -88,6 +88,9 @@ public class PostPagingSource extends ListenableFuturePagingSource this.postFeedScrolledPositionSharedPreferences = postFeedScrolledPositionSharedPreferences; if (postType == TYPE_SUBREDDIT || postType == TYPE_ANONYMOUS_FRONT_PAGE || postType == TYPE_ANONYMOUS_MULTIREDDIT) { this.subredditOrUserName = path; + if (subredditOrUserName == null) { + subredditOrUserName = "popular"; + } } else { if (sortType != null) { if (path.endsWith("/")) { @@ -101,7 +104,7 @@ public class PostPagingSource extends ListenableFuturePagingSource } this.postType = postType; if (sortType == null) { - if (path.equals("popular") || path.equals("all")) { + if ("popular".equals(path) || "all".equals(path)) { this.sortType = new SortType(SortType.Type.HOT); } else { this.sortType = new SortType(SortType.Type.BEST); -- cgit v1.2.3