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

This commit is contained in:
Deluan 2021-10-16 20:29:31 -04:00 committed by Joe Stump
parent f22e0fed9a
commit 84c1c0cf68
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9

View File

@ -109,14 +109,14 @@ export const SongDatagridRow = ({
const [, dragDiscRef] = useDrag(() => ({
type: DraggableTypes.DISC,
item: {
discs: [{ albumId: record.albumId, discNumber: record.discNumber }],
discs: [{ albumId: record?.albumId, discNumber: record?.discNumber }],
},
options: { dropEffect: 'copy' },
}))
const [, dragSongRef] = useDrag(() => ({
type: DraggableTypes.SONG,
item: { ids: [record.id] },
item: { ids: [record?.id] },
options: { dropEffect: 'copy' },
}))