From a7d76d48055f250a9d6b1e8eae7248f93c1f4b8c Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 16 Mar 2021 19:03:36 +0100 Subject: [PATCH] fix NPE --- .../pump/omnipod/eros/manager/AapsOmnipodErosManager.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java index bf99a4ad0b..5379970620 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java @@ -463,7 +463,7 @@ public class AapsOmnipodErosManager { } } - String comment = null; + String comment = "Unknown"; for (int i = 1; delegate.hasActiveBolus(); i++) { aapsLogger.debug(LTag.PUMP, "Attempting to cancel bolus (#{})", i); @@ -704,8 +704,7 @@ public class AapsOmnipodErosManager { public void addBolusToHistory(DetailedBolusInfo originalDetailedBolusInfo) { DetailedBolusInfo detailedBolusInfo = originalDetailedBolusInfo.copy(); - long pumpId = addSuccessToHistory(detailedBolusInfo.date, PodHistoryEntryType.SET_BOLUS, detailedBolusInfo.insulin + ";" + detailedBolusInfo.carbs); - detailedBolusInfo.pumpId = pumpId; + detailedBolusInfo.pumpId = addSuccessToHistory(detailedBolusInfo.date, PodHistoryEntryType.SET_BOLUS, detailedBolusInfo.insulin + ";" + detailedBolusInfo.carbs); if (detailedBolusInfo.carbs > 0 && detailedBolusInfo.carbTime > 0) { // split out a separate carbs record without a pumpId @@ -1004,7 +1003,7 @@ public class AapsOmnipodErosManager { private void uploadCareportalEvent(long date, TherapyEvent.Type event) { if (repository.getTherapyEventByTimestamp(event, date) != null) return; - disposable.add(repository.runTransactionForResult(new InsertTherapyEventIfNewTransaction(date, event, 0, null, sp.getString("careportal_enteredby", "AndroidAPS"), null, null, null)) + disposable.add(repository.runTransactionForResult(new InsertTherapyEventIfNewTransaction(date, event, 0, null, sp.getString("careportal_enteredby", "AndroidAPS"), null, null, TherapyEvent.GlucoseUnit.MGDL)) .subscribe( result -> result.getInserted().forEach(nsUpload::uploadEvent), error -> aapsLogger.error(LTag.DATABASE, "Error while saving therapy event", error)