mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 11:10:58 +02:00
Fix a few other bugs
This commit is contained in:
@@ -2149,11 +2149,15 @@ function NetscriptFunctions(workerScript) {
|
||||
}
|
||||
return port.write(data);
|
||||
} else if (isString(port)) { // Write to script or text file
|
||||
const fn = removeLeadingSlash(port);
|
||||
let fn = port;
|
||||
if (!isValidFilePath(fn)) {
|
||||
throw makeRuntimeErrorMsg("write", `Invalid filepath: ${fn}`);
|
||||
}
|
||||
|
||||
if(fn.lastIndexOf("/") === 0) {
|
||||
fn = removeLeadingSlash(fn);
|
||||
}
|
||||
|
||||
// Coerce 'data' to be a string
|
||||
try {
|
||||
data = String(data);
|
||||
|
||||
Reference in New Issue
Block a user