From 8115b62e73c5eecf615ab4e1a0b9a29afe638e51 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 18 Mar 2023 09:19:20 +0000 Subject: [PATCH] Fix: add nullguards to `getResponse()` --- project/src/routers/HttpRouter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/src/routers/HttpRouter.ts b/project/src/routers/HttpRouter.ts index b86bfb34..45283145 100644 --- a/project/src/routers/HttpRouter.ts +++ b/project/src/routers/HttpRouter.ts @@ -37,7 +37,7 @@ export class HttpRouter let url = req.url; // remove retry from url - if (url.includes("?retry=")) + if (url?.includes("?retry=")) { url = url.split("?retry=")[0]; } @@ -48,7 +48,7 @@ export class HttpRouter } // TODO: Temporary hack to change ItemEventRouter response sessionID binding to what client expects - if (wrapper.output.includes("\"profileChanges\":{")) + if (wrapper.output?.includes("\"profileChanges\":{")) { wrapper.output = wrapper.output.replace(sessionID, `pmc${sessionID}`); }