mirror of
https://github.com/hoppscotch/hoppscotch
synced 2024-11-23 15:48:33 +00:00
fix: handle invalid input for shortcode properties
This commit is contained in:
parent
2e445224da
commit
4dcb0afb18
@ -126,7 +126,7 @@ export class ShortcodeService implements UserDataHandler, OnModuleInit {
|
|||||||
return E.left(SHORTCODE_INVALID_REQUEST_JSON);
|
return E.left(SHORTCODE_INVALID_REQUEST_JSON);
|
||||||
|
|
||||||
const parsedProperties = stringToJson(properties);
|
const parsedProperties = stringToJson(properties);
|
||||||
if (E.isLeft(parsedProperties))
|
if (E.isLeft(parsedProperties) || !parsedProperties.right)
|
||||||
return E.left(SHORTCODE_INVALID_PROPERTIES_JSON);
|
return E.left(SHORTCODE_INVALID_PROPERTIES_JSON);
|
||||||
|
|
||||||
const generatedShortCode = await this.generateUniqueShortCodeID();
|
const generatedShortCode = await this.generateUniqueShortCodeID();
|
||||||
|
Loading…
Reference in New Issue
Block a user