diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-06-27 14:50:19 +0900 |
---|---|---|
committer | Lukáš Nykrýn <lnykryn@redhat.com> | 2019-05-03 13:30:26 +0200 |
commit | 8ae19bfcfe0a52b55171f4f60772afe418831230 (patch) | |
tree | cec3c79df4fc396b605994fa8400a88f24937ccd | |
parent | b7786387a6cdc447b874f36a8d9831b1acd2eb13 (diff) | |
download | systemd-8ae19bfcfe0a52b55171f4f60772afe418831230.tar.gz |
journal-gateway: use localStorage["cursor"] only when it has valid valuev239-15
Discovered by LGTM.
(cherry picked from commit 944072feddb73333023d0a98bf87fd2a17f894d3)
Resolves: #1705971
-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"; |