Skip to content

Commit 4617d27

Browse files
yuwatakeszybz
authored andcommitted
journal-gateway: use localStorage["cursor"] only when it has valid value
Discovered by LGTM. (cherry picked from commit 944072f)
1 parent 6dfae27 commit 4617d27

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/journal-remote/browse.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,12 @@ <h1 id="title"></h1>
236236

237237
function entriesLoad(range) {
238238

239-
if (range == null)
240-
range = localStorage["cursor"] + ":0";
241-
if (range == null)
242-
range = "";
239+
if (range == null) {
240+
if (localStorage["cursor"] != null && localStorage["cursor"] != "")
241+
range = localStorage["cursor"] + ":0";
242+
else
243+
range = "";
244+
}
243245

244246
var url = "/entries";
245247

0 commit comments

Comments
 (0)