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

Commit

Permalink
Merge pull request #57 from thefringeninja/jasun
Browse files Browse the repository at this point in the history
Don't Send Empty String when JSON is not Set
  • Loading branch information
thefringeninja authored Feb 13, 2019
2 parents 0ad5389 + d95b41a commit 24aaec6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/HyperMediaControls/TextAreaField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ class TextAreaField extends React.PureComponent<
): void => {
const { form, onChangeValidate } = this.props;

const tryParseJson = (value: string): string | object => {
const tryParseJson = (value: string): string | object | undefined => {
if (!value) {
return undefined;
}
try {
return JSON.parse(value);
} catch (e) {
Expand Down

0 comments on commit 24aaec6

Please sign in to comment.