fix(client): avoid cannot getField by randomly generated name and throw error (#294)
Co-authored-by: chenos <chenlinxh@gmail.com>
This commit is contained in:
parent
fcfde7ed0a
commit
8e11e8d364
@ -18,7 +18,7 @@ export const ReadPrettyRecordPicker: React.FC = observer((props: any) => {
|
||||
const { getField } = useCollection();
|
||||
const collectionField = getField(fieldSchema.name);
|
||||
const [record, setRecord] = useState({});
|
||||
return (
|
||||
return collectionField ? (
|
||||
<div>
|
||||
<BlockAssociationContext.Provider value={`${collectionField.collectionName}.${collectionField.name}`}>
|
||||
<CollectionProvider name={collectionField.target}>
|
||||
@ -48,5 +48,5 @@ export const ReadPrettyRecordPicker: React.FC = observer((props: any) => {
|
||||
</CollectionProvider>
|
||||
</BlockAssociationContext.Provider>
|
||||
</div>
|
||||
);
|
||||
) : null;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user