Skip to content

Commit

Permalink
fix: check if HeaderFragment is attached
Browse files Browse the repository at this point in the history
parentFragmentManager may throw if not
  • Loading branch information
BrayanDSO committed Dec 6, 2024
1 parent 65f9c12 commit d7502d1
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class HeaderFragment : PreferenceFragmentCompat(), TitleProvider {
}

parentFragmentManager.addOnBackStackChangedListener {
if (!isAdded) return@addOnBackStackChangedListener
val fragment = parentFragmentManager.findFragmentById(R.id.settings_container)
?: return@addOnBackStackChangedListener

Expand Down

0 comments on commit d7502d1

Please sign in to comment.