mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 09:43:54 +01:00
Recover from null moneyTracker
There shouldn't be any way to get null, but it was reported to occur and this will recover when this happens.
This commit is contained in:
parent
959307aa13
commit
d0820c81ce
@ -31,7 +31,7 @@ export class MoneySourceTracker {
|
|||||||
// Record money earned
|
// Record money earned
|
||||||
record(amt: number, source: string): void {
|
record(amt: number, source: string): void {
|
||||||
const sanitizedSource = source.toLowerCase();
|
const sanitizedSource = source.toLowerCase();
|
||||||
if (typeof this[sanitizedSource] !== "number") {
|
if (typeof this[sanitizedSource] !== "number" && this[sanitizedSource] !== null) {
|
||||||
console.warn(`MoneySourceTracker.record() called with invalid source: ${source}`);
|
console.warn(`MoneySourceTracker.record() called with invalid source: ${source}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user