From 533b45c01ac903845bb6c3c9fa22a6e36dcb85e4 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Mon, 20 Feb 2023 00:23:08 -0500 Subject: Fix suggested sort enum parsing error. --- .../infinityforreddit/fragments/ViewPostDetailFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java index 8ca0d0ea..56e9af8e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java @@ -1437,7 +1437,12 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic mRespectSubredditRecommendedSortType = false; sortTypeType = loadSortType(); } else { - sortTypeType = SortType.Type.valueOf(suggestedCommentSort.toUpperCase(Locale.US)); + try { + sortTypeType = SortType.Type.valueOf(suggestedCommentSort.toUpperCase(Locale.US)); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + sortTypeType = loadSortType(); + } } activity.setTitle(sortTypeType.fullName); ViewPostDetailFragment.this.sortType = sortTypeType; -- cgit v1.2.3