mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
API: Print error message when calling ns.ui.closeTail with nonexistent pid or pid of stopped scripts (#2557)
This commit is contained in:
@@ -70,7 +70,12 @@ export function NetscriptUserInterface(): InternalAPI<IUserInterface> {
|
||||
(ctx) =>
|
||||
(_pid = ctx.workerScript.scriptRef.pid) => {
|
||||
const pid = helpers.number(ctx, "pid", _pid);
|
||||
//Emit an event to tell the game to close the tail window if it exists
|
||||
const runningScriptObj = helpers.getRunningScript(ctx, pid);
|
||||
if (runningScriptObj == null) {
|
||||
helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(pid));
|
||||
return;
|
||||
}
|
||||
// Emit an event to tell the game to close the tail window if it exists.
|
||||
LogBoxCloserEvents.emit(pid);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user