From 088841ae2312bf78af9d3f04ed2e3605c42e602c Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Mon, 19 Mar 2018 20:23:45 +0100 Subject: [PATCH] TDD 08 - fix crash on empty --- .../main/java/info/nightscout/androidaps/TDDStatsActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java b/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java index 48ae30f6d2..6954e93a69 100644 --- a/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java @@ -435,7 +435,7 @@ public class TDDStatsActivity extends Activity { tl.setBackgroundColor(Color.TRANSPARENT); } - if(df.format(new Date(historyList.get(0).date)).equals(df.format(new Date()))) { + if(!historyList.isEmpty() && df.format(new Date(historyList.get(0).date)).equals(df.format(new Date()))) { //Today should not be included historyList.remove(0); }