prevent NPE

This commit is contained in:
Milos Kozak 2021-01-14 18:45:51 +01:00
parent 90f6908b22
commit 4c9052b29a

View file

@ -158,7 +158,7 @@ class TreatmentsBolusFragment : DaggerFragment() {
}
calculation.paintFlags = calculation.paintFlags or Paint.UNDERLINE_TEXT_FLAG
remove.setOnClickListener {
val treatment = it.tag as Treatment
val treatment = it.tag as Treatment? ?: return@setOnClickListener
activity?.let { activity ->
val text = resourceHelper.gs(R.string.configbuilder_insulin) + ": " +
resourceHelper.gs(R.string.formatinsulinunits, treatment.insulin) + "\n" +