Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ public void pushScreen(Fragment fragment, @Nullable Bundle options) {
ft.setCustomAnimations(anim.enter, anim.exit, anim.popEnter, anim.popExit);
}
BackStack bsi = getCurrentBackStack();
if (bsi == null) {
Log.w(TAG, "Trying to push with a null BackStack.");
return;
}
ft
.detach(currentFragment)
.add(container.getId(), fragment)
Expand Down Expand Up @@ -209,6 +213,10 @@ public void onBackPressed() {

public void pop() {
BackStack bsi = getCurrentBackStack();
if (bsi == null) {
Log.w(TAG, "Trying to pop with a null BackStack.");
return;
}
if (bsi.getSize() == 1) {
dismiss();
return;
Expand Down Expand Up @@ -281,7 +289,10 @@ private Fragment getCurrentFragment() {
}

private BackStack getCurrentBackStack() {
return backStacks.peek();
if (backStacks.size() > 0) {
return backStacks.peek();
}
return null;
}

@NonNull
Expand Down