Fix suggested sort enum parsing error.

This commit is contained in:
Docile-Alligator 2023-02-20 00:23:08 -05:00
parent e88c2e957b
commit 533b45c01a

View File

@ -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;