Add null check for total insulin delivered in Omnipod tab

This commit is contained in:
Bart Sopers 2020-08-23 22:40:32 +02:00
parent f94c73a911
commit 15b0701d06

View file

@ -281,7 +281,7 @@ class OmnipodFragment : DaggerFragment() {
.getTempBasalFromHistory(System.currentTimeMillis())?.toStringFull() ?: "-"
// total delivered
omnipod_total_delivered.text = if (podStateManager.isPodActivationCompleted) {
omnipod_total_delivered.text = if (podStateManager.isPodActivationCompleted && podStateManager.totalInsulinDelivered != null) {
resourceHelper.gs(R.string.omnipod_total_delivered, podStateManager.totalInsulinDelivered - OmnipodConst.POD_SETUP_UNITS);
} else {
"-"