Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit d95b41a

Browse files
jsonMetadata is not required; if not set then it should be undefined
1 parent 0ad5389 commit d95b41a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/components/HyperMediaControls/TextAreaField.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ class TextAreaField extends React.PureComponent<
2121
): void => {
2222
const { form, onChangeValidate } = this.props;
2323

24-
const tryParseJson = (value: string): string | object => {
24+
const tryParseJson = (value: string): string | object | undefined => {
25+
if (!value) {
26+
return undefined;
27+
}
2528
try {
2629
return JSON.parse(value);
2730
} catch (e) {

0 commit comments

Comments
 (0)