Skip to content

Commit

Permalink
Fix crash in setMenuVisibility due to null Context
Browse files Browse the repository at this point in the history
This only happened after the latest dependecies updates,
not on production
  • Loading branch information
emanuele-f committed Dec 24, 2023
1 parent 89ae52a commit 852c7ca
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
@Override
public void setMenuVisibility(boolean menuVisible) {
super.setMenuVisibility(menuVisible);

Context context = getContext();
if(context == null)
return;

Log.d(TAG, "setMenuVisibility : " + menuVisible);
Context context = requireContext();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

if(menuVisible && !payloadNoticeAcknowledged(prefs)) {
Expand Down

0 comments on commit 852c7ca

Please sign in to comment.