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 f77e2a6 commit 816eddc
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,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 816eddc

Please sign in to comment.