We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87bac31 commit 790b249Copy full SHA for 790b249
src/Json.js
@@ -31,8 +31,10 @@ class Json extends Component {
31
const { valueType, onChange } = this.props
32
33
try {
34
- value = JSON.parse(value)
35
- if (valueType === 'string') value = JSON.stringify(value, null, 4)
+ if (value) {
+ value = JSON.parse(value)
36
+ if (valueType === 'string') value = JSON.stringify(value, null, 4)
37
+ }
38
onChange(value)
39
} catch (e) {
40
onChange(new Error(format(getLang('validation.tips.json'), '')))
0 commit comments