mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:25:15 +00:00
chore(default): avoid crashing
This commit is contained in:
parent
3b53d7c623
commit
fa3127e467
@ -39,6 +39,13 @@ const ToOneNester = (props) => {
|
||||
const recordRef = React.useRef(_.omit(record, '__parent'));
|
||||
|
||||
const isAllowToSetDefaultValue = useCallback(({ form, fieldSchema, collectionField, getInterface }) => {
|
||||
if (!collectionField) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.error(`collectionField should not be ${collectionField}`);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 当 Field component 不是下列组件时,不允许设置默认值
|
||||
if (
|
||||
collectionField.target &&
|
||||
@ -85,6 +92,13 @@ const ToManyNester = observer(
|
||||
}
|
||||
|
||||
const isAllowToSetDefaultValue = useCallback(({ form, fieldSchema, collectionField, getInterface }) => {
|
||||
if (!collectionField) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.error(`collectionField should not be ${collectionField}`);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 当 Field component 不是下列组件时,不允许设置默认值
|
||||
if (
|
||||
collectionField.target &&
|
||||
|
@ -98,6 +98,13 @@ function _isAllowToSetDefaultValue({
|
||||
);
|
||||
}
|
||||
|
||||
if (!collectionField) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.error(`collectionField should not be ${collectionField}`);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 当 Field component 不是下列组件时,不允许设置默认值
|
||||
if (
|
||||
collectionField.target &&
|
||||
|
Loading…
Reference in New Issue
Block a user