prevent NPE
This commit is contained in:
parent
5e3db95297
commit
22cad1a761
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
package info.nightscout.androidaps.activities.fragments
|
package info.nightscout.androidaps.activities.fragments
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.graphics.Paint
|
import android.graphics.Paint
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
@ -84,6 +85,7 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
|
||||||
TreatmentsBolusCarbsFragmentBinding.inflate(inflater, container, false).also { _binding = it }.root
|
TreatmentsBolusCarbsFragmentBinding.inflate(inflater, container, false).also { _binding = it }.root
|
||||||
|
|
||||||
|
@SuppressLint("CheckResult")
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
binding.recyclerview.setHasFixedSize(true)
|
binding.recyclerview.setHasFixedSize(true)
|
||||||
|
@ -320,7 +322,7 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
binding.calculation.setOnClickListener {
|
binding.calculation.setOnClickListener {
|
||||||
val mealLinkLoaded = it.tag as MealLink
|
val mealLinkLoaded = it.tag as MealLink? ?: return@setOnClickListener
|
||||||
mealLinkLoaded.bolusCalculatorResult?.let { bolusCalculatorResult ->
|
mealLinkLoaded.bolusCalculatorResult?.let { bolusCalculatorResult ->
|
||||||
WizardInfoDialog().also { wizardDialog ->
|
WizardInfoDialog().also { wizardDialog ->
|
||||||
wizardDialog.setData(bolusCalculatorResult)
|
wizardDialog.setData(bolusCalculatorResult)
|
||||||
|
|
Loading…
Reference in a new issue