From 0b50385b84071c8140dbfe4524dbd34b6461e1c0 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 14 Oct 2023 10:31:01 +0100 Subject: [PATCH] Fix error on death because extract is undefined --- project/src/controllers/MatchController.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/project/src/controllers/MatchController.ts b/project/src/controllers/MatchController.ts index ae42e01e..4823d77e 100644 --- a/project/src/controllers/MatchController.ts +++ b/project/src/controllers/MatchController.ts @@ -198,7 +198,7 @@ export class MatchController 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); } @@ -211,6 +211,12 @@ export class MatchController */ protected extractWasViaCoop(extractName: string): boolean { + // No extract name, not a coop extract + if (!extractName) + { + return false; + } + return (this.inraidConfig.coopExtracts.includes(extractName.trim())); }