From edb75c4bab85bbe914a5c22a2bef880820b752e1 Mon Sep 17 00:00:00 2001 From: Somethingweirdhere Date: Fri, 8 Jun 2018 21:27:50 +0200 Subject: [PATCH] Fixed crash in Subscriptions section --- .../subscription/SubscriptionFragment.java | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.java b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.java index c194069fb..bbd1150c4 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.java @@ -13,6 +13,7 @@ import android.os.Parcelable; import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.support.v4.app.FragmentManager; import android.support.v4.content.LocalBroadcastManager; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; @@ -241,8 +242,15 @@ public class SubscriptionFragment extends BaseStateFragment - NavigationHelper.openWhatsNewFragment(getParentFragment().getFragmentManager())); + { + FragmentManager fragmentManager; + + if (getParentFragment() == null) + { + fragmentManager = getFragmentManager(); + } else { + fragmentManager = getParentFragment().getFragmentManager(); + } + NavigationHelper.openWhatsNewFragment(fragmentManager); + }); importExportListHeader.setOnClickListener(v -> importExportOptions.switchState()); }