Fix crash related to the "swipe between posts" options

There was a null pointer execution because it did not check for a null value.
This commit is contained in:
Balazs Toldi 2023-11-05 16:19:51 +01:00
parent fe565d2ef3
commit 6b09f0379c
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58

View File

@ -557,7 +557,7 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele
// TODO: Implement anonymous front page
default:
String type = (subredditName.equals("all")) ? "All" : (subredditName.equals("local")) ? "Local" : "Subscribed";
String type = (subredditName == null) ? "Subscribed" : (subredditName.equals("all")) ? "All" : "Local";
call = api.getPosts(type, sortType.value, nextPage, 25, null, null, false, mAccessToken);
}