From 6fb5f5bad4bd1b63d93b4163987422e13779156d Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Wed, 7 Feb 2018 15:23:29 +0100 Subject: [PATCH] Check result.success when hard cancelling TBR. (cherry picked from commit 654f984) --- .../nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java index ccbcf7f913..b0e7f0f376 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java @@ -792,6 +792,9 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf if (enforceNew) { log.debug("cancelTempBasal: hard-cancelling TBR since force requested"); CommandResult commandResult = runCommand(MainApp.gs(R.string.combo_pump_action_cancelling_tbr), 2, ruffyScripter::cancelTbr); + if (!commandResult.success) { + return new PumpEnactResult().success(false).enacted(false); + } if (!commandResult.state.tbrActive) { TemporaryBasal tempBasal = new TemporaryBasal(); tempBasal.date = commandResult.state.timestamp;