]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal-gateway: use localStorage["cursor"] only when it has valid value 9440/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 27 Jun 2018 05:50:19 +0000 (14:50 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 27 Jun 2018 05:50:23 +0000 (14:50 +0900)
Discovered by LGTM.

src/journal-remote/browse.html

index 9f519adbd69840d166c751520822f9c6553002ac..e5162d108897d26f340dd9a181309e3591b67ecd 100644 (file)
 
                 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";