summaryrefslogtreecommitdiffstats
path: root/src/journal-remote
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-06-27 07:50:19 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-06-27 07:50:23 +0200
commit944072feddb73333023d0a98bf87fd2a17f894d3 (patch)
tree01e721d872aec5233bdca1ec87b756bd0e953b67 /src/journal-remote
parentjournal-gateway: explicitly declare local variables (diff)
downloadsystemd-944072feddb73333023d0a98bf87fd2a17f894d3.tar.xz
systemd-944072feddb73333023d0a98bf87fd2a17f894d3.zip
journal-gateway: use localStorage["cursor"] only when it has valid value
Discovered by LGTM.
Diffstat (limited to 'src/journal-remote')
-rw-r--r--src/journal-remote/browse.html10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/journal-remote/browse.html b/src/journal-remote/browse.html
index 9f519adbd6..e5162d1088 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";