From: Yu Watanabe Date: Wed, 27 Jun 2018 05:50:19 +0000 (+0900) Subject: journal-gateway: use localStorage["cursor"] only when it has valid value X-Git-Tag: v240~1031^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9440%2Fhead;p=thirdparty%2Fsystemd.git journal-gateway: use localStorage["cursor"] only when it has valid value Discovered by LGTM. --- diff --git a/src/journal-remote/browse.html b/src/journal-remote/browse.html index 9f519adbd69..e5162d10889 100644 --- a/src/journal-remote/browse.html +++ b/src/journal-remote/browse.html @@ -236,10 +236,12 @@ function entriesLoad(range) { - if (range == null) - range = localStorage["cursor"] + ":0"; - if (range == null) - range = ""; + if (range == null) { + if (localStorage["cursor"] != null && localStorage["cursor"] != "") + range = localStorage["cursor"] + ":0"; + else + range = ""; + } var url = "/entries";