From bb3920d32a7ba186ae2d5267f5d2f336cf8ab13b Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Wed, 16 Jun 2021 01:58:06 +0200 Subject: [PATCH] Fixed empty uptime journal case. --- .../statoolinfos/uptime/UptimeJournal.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/fr/devinsy/statoolinfos/uptime/UptimeJournal.java b/src/fr/devinsy/statoolinfos/uptime/UptimeJournal.java index 6791643..865add7 100644 --- a/src/fr/devinsy/statoolinfos/uptime/UptimeJournal.java +++ b/src/fr/devinsy/statoolinfos/uptime/UptimeJournal.java @@ -309,6 +309,10 @@ public class UptimeJournal { result = false; } + else if (isEmpty()) + { + result = false; + } else { boolean ended = false; @@ -340,6 +344,21 @@ public class UptimeJournal return result; } + /** + * Checks if is empty. + * + * @return true, if is empty + */ + public boolean isEmpty() + { + boolean result; + + result = this.map.isEmpty(); + + // + return result; + } + /** * Purge. *