diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-06-27 07:50:19 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-06-27 07:50:23 +0200 |
commit | 944072feddb73333023d0a98bf87fd2a17f894d3 (patch) | |
tree | 01e721d872aec5233bdca1ec87b756bd0e953b67 /src/journal-remote/browse.html | |
parent | journal-gateway: explicitly declare local variables (diff) | |
download | systemd-944072feddb73333023d0a98bf87fd2a17f894d3.tar.xz systemd-944072feddb73333023d0a98bf87fd2a17f894d3.zip |
journal-gateway: use localStorage["cursor"] only when it has valid value
Discovered by LGTM.
Diffstat (limited to '')
-rw-r--r-- | src/journal-remote/browse.html | 10 |
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"; |