Guard against record being `undefined`. Fix error `Cannot read properties of undefined (reading 'id')`

This commit is contained in:
Deluan 2021-10-19 20:22:56 -04:00
parent 5621551dd0
commit 104679ca6e
1 changed files with 1 additions and 1 deletions

View File

@ -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} />