From 08542cd16ff9cc5476bee6c792e23a0ffce57f35 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Mon, 9 Sep 2024 12:03:10 +0200 Subject: [PATCH] fix(Timeline/Hashtag): check if hashtag is null Fixes a crash when clicking on hashtags in profiles, since the hashtag is for some reason null. --- .../joinmastodon/android/fragments/HashtagTimelineFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HashtagTimelineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HashtagTimelineFragment.java index b5bf46d827..d2a1cc0240 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HashtagTimelineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HashtagTimelineFragment.java @@ -295,7 +295,7 @@ private void createOptionsMenu(){ followMenuItem=optionsMenu.findItem(R.id.follow_hashtag); pinMenuItem=optionsMenu.findItem(R.id.pin); followMenuItem.setVisible(toolbarContentVisible); - updateFollowState(hashtag.following); + updateFollowState(hashtag!=null && hashtag.following); // pinMenuItem.setShowAsAction(toolbarContentVisible ? MenuItem.SHOW_AS_ACTION_NEVER : MenuItem.SHOW_AS_ACTION_ALWAYS); super.updatePinButton(pinMenuItem);