fix TypeError when config is undefined (#12697)

This commit is contained in:
Keith Grant 2022-08-30 12:11:45 -07:00 committed by GitHub
parent 310e354164
commit 39f6e2fa32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -440,8 +440,9 @@ const ObjectField = ({ name, config, revertValue, isRequired = false }) => {
const [field, meta, helpers] = useField({ name, validate });
const isValid = !(meta.touched && meta.error);
const defaultRevertValue =
config?.default !== null ? JSON.stringify(config.default, null, 2) : null;
const defaultRevertValue = config?.default
? JSON.stringify(config.default, null, 2)
: null;
return config ? (
<FormFullWidthLayout>