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 7, 2024
1 parent 48f5fb0 commit 02355df
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,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 02355df

Please sign in to comment.