fix exception in sms comm

This commit is contained in:
Milos Kozak 2017-05-02 22:49:17 +02:00
parent 1b69771893
commit b80c382512

View file

@ -262,6 +262,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
Answers.getInstance().logCustom(new CustomEvent("SMS_Bg"));
break;
case "LOOP":
if (splited.length > 1)
switch (splited[1].toUpperCase()) {
case "DISABLE":
case "STOP":
@ -333,6 +334,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
}
break;
case "TREATMENTS":
if (splited.length > 1)
switch (splited[1].toUpperCase()) {
case "REFRESH":
Intent restartNSClient = new Intent(Intents.ACTION_RESTART);
@ -347,6 +349,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
}
break;
case "NSCLIENT":
if (splited.length > 1)
switch (splited[1].toUpperCase()) {
case "RESTART":
Intent restartNSClient = new Intent(Intents.ACTION_RESTART);
@ -450,7 +453,7 @@ public class SmsCommunicatorPlugin implements PluginBase {
PumpInterface pumpInterface = MainApp.getConfigBuilder();
if (pumpInterface != null) {
danaRPlugin = (DanaRPlugin) MainApp.getSpecificPlugin(DanaRPlugin.class);
PumpEnactResult result = pumpInterface.deliverTreatment(MainApp.getConfigBuilder().getActiveInsulin() ,bolusWaitingForConfirmation.bolusRequested, 0, null);
PumpEnactResult result = pumpInterface.deliverTreatment(MainApp.getConfigBuilder().getActiveInsulin(), bolusWaitingForConfirmation.bolusRequested, 0, null);
if (result.success) {
reply = String.format(MainApp.sResources.getString(R.string.smscommunicator_bolusdelivered), result.bolusDelivered);
if (danaRPlugin != null)