From 4c9052b29a166cb946fcc138afaa92458ff95b34 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 14 Jan 2021 18:45:51 +0100 Subject: [PATCH] prevent NPE --- .../plugins/treatments/fragments/TreatmentsBolusFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsBolusFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsBolusFragment.kt index 421cfe172a..c4639114d4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsBolusFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsBolusFragment.kt @@ -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" +