From 790d60e3ed691087e23b097e89664bc4559fcc26 Mon Sep 17 00:00:00 2001 From: Victor Elias Date: Wed, 9 Oct 2024 15:19:33 -0300 Subject: [PATCH] api/access-control: Fix NRE on error log 2024-10-09 15:08:18.542 2024-10-09 18:08:18 [error]: Unhandled error in API path=/api/access-control/gate errType=TypeError err="The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined" stack=TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined 2024-10-09 15:08:18.542 at new NodeError (node:internal/errors:405:5) 2024-10-09 15:08:18.542 at Function.from (node:buffer:325:9) 2024-10-09 15:08:18.542 at ewa (/usr/local/src/controllers/access-control.ts:147:30) 2024-10-09 15:08:18.542 at /usr/local/src/controllers/access-control.ts:372:28 --- packages/api/src/controllers/access-control.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api/src/controllers/access-control.ts b/packages/api/src/controllers/access-control.ts index fc27537bd..a6972781c 100644 --- a/packages/api/src/controllers/access-control.ts +++ b/packages/api/src/controllers/access-control.ts @@ -81,7 +81,7 @@ async function fireGateWebhook( const startTime = process.hrtime(); let resp: Response; - let respBody: string; + let respBody = ""; let errorMessage: string; let statusCode: number; let bodyStatusCode: number;