wget() Netscript function always returns a Promise

This commit is contained in:
danielyxie 2018-09-27 23:45:13 -05:00
parent eb1a7cf8a0
commit 0e7b6599bb

@ -2265,7 +2265,7 @@ function NetscriptFunctions(workerScript) {
if (workerScript.checkingRam) { return 0; } if (workerScript.checkingRam) { return 0; }
if (!isScriptFilename(target) && !target.endsWith(".txt")) { if (!isScriptFilename(target) && !target.endsWith(".txt")) {
workerSript.log(`ERROR: wget() failed because of an invalid target file: ${target}. Target file must be a script or text file`); workerSript.log(`ERROR: wget() failed because of an invalid target file: ${target}. Target file must be a script or text file`);
return false; return Promise.resolve(false);
} }
var s = safeGetServer(ip, "wget"); var s = safeGetServer(ip, "wget");
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {