From 294253797cc3819482998bd8e3d9807d00b15ef9 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 3 Aug 2018 21:13:19 +0200 Subject: [PATCH] fix NPE --- .../androidaps/plugins/Overview/graphData/GraphData.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphData/GraphData.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphData/GraphData.java index 30ed626b89..139aa6e30f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphData/GraphData.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/graphData/GraphData.java @@ -331,6 +331,8 @@ public class GraphData { } private double getNearestBg(long date) { + if (bgReadingsArray == null) + return Profile.fromMgdlToUnits(100, units); for (int r = 0; r < bgReadingsArray.size(); r++) { BgReading reading = bgReadingsArray.get(r); if (reading.date > date) continue;