From 38a09ec869505a7d6628b6fdc85bac6f3de44778 Mon Sep 17 00:00:00 2001 From: echicken <> Date: Thu, 17 Oct 2019 02:52:39 +0000 Subject: [PATCH] Line might could be null. --- xtrn/go-for/go-for.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xtrn/go-for/go-for.js b/xtrn/go-for/go-for.js index 615f2da7e2..0c989083cc 100644 --- a/xtrn/go-for/go-for.js +++ b/xtrn/go-for/go-for.js @@ -173,7 +173,7 @@ function go_fetch(host, port, selector, type, query) { var parsed; f.open('w'); while (!js.terminated && !console.aborted && socket.is_connected && fs <= max_dir_size && (line = socket.recvline()) != '.') { - if (line) { + if (line !== null) { last_dl = time(); parsed = JSON.stringify(parse_line(line)); f.writeln(parsed); @@ -185,9 +185,11 @@ function go_fetch(host, port, selector, type, query) { f.open('w'); while (!js.terminated && !console.aborted && socket.is_connected && fs <= max_text_size) { line = socket.recvline(); - f.writeln(line); - last_dl = time(); - fs += line.length; + if (line !== null) { + f.writeln(line); + last_dl = time(); + fs += line.length; + } } f.close(); } else if (['4', '5', '9', 'g', 'I'].indexOf(type) > -1) { // this is a binary file -- GitLab