From 8b77b6663e94881290435efe130d18532687429f Mon Sep 17 00:00:00 2001 From: Felix Date: Sat, 15 Apr 2017 19:58:35 +0200 Subject: [PATCH] fix crash when going back while activity is launching --- .../chaosflix/fragments/BrowseErrorFragment.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/nicidienase/chaosflix/fragments/BrowseErrorFragment.java b/app/src/main/java/de/nicidienase/chaosflix/fragments/BrowseErrorFragment.java index c557936f..ec07feb4 100644 --- a/app/src/main/java/de/nicidienase/chaosflix/fragments/BrowseErrorFragment.java +++ b/app/src/main/java/de/nicidienase/chaosflix/fragments/BrowseErrorFragment.java @@ -68,8 +68,11 @@ public class BrowseErrorFragment extends ErrorFragment{ } public void dismiss() { - getFragmentManager().beginTransaction().remove(BrowseErrorFragment.this).commit(); - getFragmentManager().popBackStack(); + FragmentManager fragmentManager = getFragmentManager(); + if(fragmentManager != null){ + fragmentManager.beginTransaction().remove(BrowseErrorFragment.this).commit(); + fragmentManager.popBackStack(); + } }