From 8adc333adec7d43c0a8106e31d5d02808bb474d9 Mon Sep 17 00:00:00 2001 From: TebbeUbben Date: Sat, 23 Jun 2018 16:02:10 +0200 Subject: [PATCH] Mark profile as invalid if high target < low target --- .../main/java/info/nightscout/androidaps/data/Profile.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/data/Profile.java b/app/src/main/java/info/nightscout/androidaps/data/Profile.java index 844fa6472a..baf992dc74 100644 --- a/app/src/main/java/info/nightscout/androidaps/data/Profile.java +++ b/app/src/main/java/info/nightscout/androidaps/data/Profile.java @@ -202,6 +202,12 @@ public class Profile { if (targetHigh_v == null) targetHigh_v = convertToSparseArray(targetHigh); validate(targetHigh_v); + + if (targetHigh_v.size() != targetLow_v.size()) isValid = false; + else for (int i = 0; i < targetHigh_v.size(); i++) + if (targetHigh_v.get(i) < targetLow_v.get(i)) + isValid = false; + isValidated = true; }