From 378bde2d735b07cd03002b23c4a0ab31f8f566e2 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 19 Jun 2021 11:00:41 +0200 Subject: [PATCH] Fixed missing item case in uptime feature. --- src/fr/devinsy/statoolinfos/uptime/UptimeJournal.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/uptime/UptimeJournal.java b/src/fr/devinsy/statoolinfos/uptime/UptimeJournal.java index 865add7..96d4226 100644 --- a/src/fr/devinsy/statoolinfos/uptime/UptimeJournal.java +++ b/src/fr/devinsy/statoolinfos/uptime/UptimeJournal.java @@ -325,10 +325,14 @@ public class UptimeJournal Service current = iterator.next(); if (current.getWebsiteURL() != null) { - if (getUptimes(current.getWebsiteURL()).last().getStatus() == UptimeStatus.ERROR) + Uptimes currentUptimes = getUptimes(current.getWebsiteURL()); + if (!currentUptimes.isEmpty()) { - ended = true; - result = true; + if (currentUptimes.last().getStatus() == UptimeStatus.ERROR) + { + ended = true; + result = true; + } } } }