Guard against record being undefined. Fix error Cannot read properties of undefined (reading 'id')
This commit is contained in:
@@ -86,7 +86,7 @@ const ArtistDatagridRow = (props) => {
|
||||
const { record } = props
|
||||
const [, dragArtistRef] = useDrag(() => ({
|
||||
type: DraggableTypes.ARTIST,
|
||||
item: { artistIds: [record.id] },
|
||||
item: { artistIds: [record?.id] },
|
||||
options: { dropEffect: 'copy' },
|
||||
}))
|
||||
return <DatagridRow ref={dragArtistRef} {...props} />
|
||||
|
||||
Reference in New Issue
Block a user