Skip to content
Snippets Groups Projects
Commit 38a09ec8 authored by echicken's avatar echicken
Browse files

Line might could be null.

parent 28aae37e
No related branches found
No related tags found
No related merge requests found
...@@ -173,7 +173,7 @@ function go_fetch(host, port, selector, type, query) { ...@@ -173,7 +173,7 @@ function go_fetch(host, port, selector, type, query) {
var parsed; var parsed;
f.open('w'); f.open('w');
while (!js.terminated && !console.aborted && socket.is_connected && fs <= max_dir_size && (line = socket.recvline()) != '.') { while (!js.terminated && !console.aborted && socket.is_connected && fs <= max_dir_size && (line = socket.recvline()) != '.') {
if (line) { if (line !== null) {
last_dl = time(); last_dl = time();
parsed = JSON.stringify(parse_line(line)); parsed = JSON.stringify(parse_line(line));
f.writeln(parsed); f.writeln(parsed);
...@@ -185,9 +185,11 @@ function go_fetch(host, port, selector, type, query) { ...@@ -185,9 +185,11 @@ function go_fetch(host, port, selector, type, query) {
f.open('w'); f.open('w');
while (!js.terminated && !console.aborted && socket.is_connected && fs <= max_text_size) { while (!js.terminated && !console.aborted && socket.is_connected && fs <= max_text_size) {
line = socket.recvline(); line = socket.recvline();
f.writeln(line); if (line !== null) {
last_dl = time(); f.writeln(line);
fs += line.length; last_dl = time();
fs += line.length;
}
} }
f.close(); f.close();
} else if (['4', '5', '9', 'g', 'I'].indexOf(type) > -1) { // this is a binary file } else if (['4', '5', '9', 'g', 'I'].indexOf(type) > -1) { // this is a binary file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment