fix: handle invalid input for shortcode properties

This commit is contained in:
Mir Arif Hasan 2023-11-06 20:23:02 +06:00
parent 2e445224da
commit 4dcb0afb18

View File

@ -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();