From 59744fbd1deff0f3cf7f034f9e7a255b95e0a214 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 19 Feb 2018 23:28:07 +0100 Subject: [PATCH] fix NPE --- .../java/info/nightscout/androidaps/plugins/Loop/APSResult.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java index 1550edd192..8050aa7769 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/APSResult.java @@ -184,7 +184,7 @@ public class APSResult { public long getLatestPredictionsTime() { long latest = 0; try { - long startTime = date.getTime(); + long startTime = date != null ? date.getTime() : 0; if (json.has("predBGs")) { JSONObject predBGs = json.getJSONObject("predBGs"); if (predBGs.has("IOB")) {