Update cleanUpCompleteCraftsInProfile() to handle when a hideout craft is cancelled by player

value in kvp will be null
This commit is contained in:
Dev 2023-12-10 22:31:55 +00:00
parent 87a40b4d2a
commit 3acd07c034

View File

@ -196,14 +196,14 @@ export class EventOutputHolder
for (const productionKey in productions) for (const productionKey in productions)
{ {
const production = productions[productionKey]; const production = productions[productionKey];
if (production.sptIsComplete && production.sptIsContinuous) if (production?.sptIsComplete && production?.sptIsContinuous)
{ {
// Water collector / Bitcoin etc // Water collector / Bitcoin etc
production.sptIsComplete = false; production.sptIsComplete = false;
production.Progress = 0; production.Progress = 0;
production.StartTimestamp = this.timeUtil.getTimestamp(); production.StartTimestamp = this.timeUtil.getTimestamp();
} }
else if (!production.inProgress) else if (!production?.inProgress)
{ {
// Normal completed craft, delete // Normal completed craft, delete
delete productions[productionKey]; delete productions[productionKey];