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

Commit 24aaec6

Browse files
Merge pull request #57 from thefringeninja/jasun
Don't Send Empty String when JSON is not Set
2 parents 0ad5389 + d95b41a commit 24aaec6

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)