mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
Merge pull request #2467 from MartinFournier/fix/load-running-scripts
Check if running script is null before offlineProd
This commit is contained in:
commit
3c047d170f
@ -638,8 +638,15 @@ export function loadAllRunningScripts(player: IPlayer): void {
|
|||||||
server.runningScripts.length = 0;
|
server.runningScripts.length = 0;
|
||||||
} else {
|
} else {
|
||||||
for (let j = 0; j < server.runningScripts.length; ++j) {
|
for (let j = 0; j < server.runningScripts.length; ++j) {
|
||||||
|
const fileName = server.runningScripts[j].filename;
|
||||||
createAndAddWorkerScript(player, server.runningScripts[j], server);
|
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
|
// Offline production
|
||||||
scriptCalculateOfflineProduction(server.runningScripts[j]);
|
scriptCalculateOfflineProduction(server.runningScripts[j]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user