mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 15:43:49 +01:00
Check if running script is null before offlineProd
This commit is contained in:
parent
d2193e017d
commit
71487337cb
@ -638,8 +638,15 @@ export function loadAllRunningScripts(player: IPlayer): void {
|
||||
server.runningScripts.length = 0;
|
||||
} else {
|
||||
for (let j = 0; j < server.runningScripts.length; ++j) {
|
||||
const fileName = server.runningScripts[j].filename;
|
||||
createAndAddWorkerScript(player, server.runningScripts[j], server);
|
||||
|
||||
if (!server.runningScripts[j]) {
|
||||
// createAndAddWorkerScript can modify the server.runningScripts array if a script is invalid
|
||||
console.error(`createAndAddWorkerScript removed ${fileName} from ${server}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Offline production
|
||||
scriptCalculateOfflineProduction(server.runningScripts[j]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user