Handle nullable fragmentManager

This commit is contained in:
Mygod
2019-01-01 12:46:07 +08:00
parent 24c1d810d5
commit 7be7af36c9
3 changed files with 6 additions and 5 deletions

View File

@@ -87,7 +87,7 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic
fun wps() {
if (binder?.active == true) WpsDialogFragment().run {
setTargetFragment(parent, TetheringFragment.REPEATER_WPS)
show(parent.fragmentManager, "WpsDialogFragment")
show(parent.fragmentManager ?: return, "WpsDialogFragment")
}
}
@@ -102,7 +102,7 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic
preSharedKey = config.psk
}))
setTargetFragment(parent, TetheringFragment.REPEATER_EDIT_CONFIGURATION)
}.show(parent.fragmentManager, WifiP2pDialogFragment.TAG)
}.show(parent.fragmentManager ?: return, WifiP2pDialogFragment.TAG)
return
} catch (e: RuntimeException) {
Timber.w(e)