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 committed by Joe Stump
parent 830784e948
commit 04beb7af07
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9

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