From 4dcb0afb184749068a11afbbb0087570d01df5d5 Mon Sep 17 00:00:00 2001 From: Mir Arif Hasan Date: Mon, 6 Nov 2023 20:23:02 +0600 Subject: [PATCH] fix: handle invalid input for shortcode properties --- packages/hoppscotch-backend/src/shortcode/shortcode.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts b/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts index 8c41a185c..f5bfb075b 100644 --- a/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts +++ b/packages/hoppscotch-backend/src/shortcode/shortcode.service.ts @@ -126,7 +126,7 @@ export class ShortcodeService implements UserDataHandler, OnModuleInit { return E.left(SHORTCODE_INVALID_REQUEST_JSON); const parsedProperties = stringToJson(properties); - if (E.isLeft(parsedProperties)) + if (E.isLeft(parsedProperties) || !parsedProperties.right) return E.left(SHORTCODE_INVALID_PROPERTIES_JSON); const generatedShortCode = await this.generateUniqueShortCodeID();