Fix error on death because extract is undefined

This commit is contained in:
Dev 2023-10-14 10:31:01 +01:00
parent f5b3377d12
commit 0b50385b84

View File

@ -198,7 +198,7 @@ export class MatchController
this.handleCarExtract(extractName, pmcData, sessionId); this.handleCarExtract(extractName, pmcData, sessionId);
} }
if (this.extractWasViaCoop(extractName) && this.traderConfig.fence.coopExtractGift.sendGift) if (extractName && this.extractWasViaCoop(extractName) && this.traderConfig.fence.coopExtractGift.sendGift)
{ {
this.sendCoopTakenFenceMessage(sessionId); this.sendCoopTakenFenceMessage(sessionId);
} }
@ -211,6 +211,12 @@ export class MatchController
*/ */
protected extractWasViaCoop(extractName: string): boolean protected extractWasViaCoop(extractName: string): boolean
{ {
// No extract name, not a coop extract
if (!extractName)
{
return false;
}
return (this.inraidConfig.coopExtracts.includes(extractName.trim())); return (this.inraidConfig.coopExtracts.includes(extractName.trim()));
} }