Prevent crash in OmnipodOverviewFragment when context is null
This commit is contained in:
parent
8f2e60d7bc
commit
1942f606b9
1 changed files with 10 additions and 8 deletions
|
@ -102,10 +102,12 @@ class OmnipodOverviewFragment : DaggerFragment() {
|
||||||
omnipod_overview_button_pod_management.setOnClickListener {
|
omnipod_overview_button_pod_management.setOnClickListener {
|
||||||
if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) {
|
if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
protectionCheck.queryProtection(
|
context?.let { context ->
|
||||||
activity, ProtectionCheck.Protection.PREFERENCES,
|
protectionCheck.queryProtection(
|
||||||
UIRunnable(Runnable { startActivity(Intent(context, PodManagementActivity::class.java)) })
|
activity, ProtectionCheck.Protection.PREFERENCES,
|
||||||
)
|
UIRunnable { startActivity(Intent(context, PodManagementActivity::class.java)) }
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
displayNotConfiguredDialog()
|
displayNotConfiguredDialog()
|
||||||
|
@ -514,10 +516,10 @@ class OmnipodOverviewFragment : DaggerFragment() {
|
||||||
|
|
||||||
private fun displayNotConfiguredDialog() {
|
private fun displayNotConfiguredDialog() {
|
||||||
context?.let {
|
context?.let {
|
||||||
UIRunnable(Runnable {
|
UIRunnable {
|
||||||
OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning),
|
OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning),
|
||||||
resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null)
|
resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null)
|
||||||
}).run()
|
}.run()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,9 +536,9 @@ class OmnipodOverviewFragment : DaggerFragment() {
|
||||||
|
|
||||||
private fun displayOkDialog(title: String, message: String) {
|
private fun displayOkDialog(title: String, message: String) {
|
||||||
context?.let {
|
context?.let {
|
||||||
UIRunnable(Runnable {
|
UIRunnable {
|
||||||
OKDialog.show(it, title, message, null)
|
OKDialog.show(it, title, message, null)
|
||||||
}).run()
|
}.run()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue