From b7fedddfd8c79fc5bdce0b5a00c645acab83e1ba Mon Sep 17 00:00:00 2001 From: Deluan Date: Sat, 16 Oct 2021 20:29:31 -0400 Subject: [PATCH] Guard against record being `undefined`. Fix error `Cannot read properties of undefined (reading 'albumId')` --- ui/src/common/SongDatagrid.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/common/SongDatagrid.js b/ui/src/common/SongDatagrid.js index c948fbfe3..2b09dac58 100644 --- a/ui/src/common/SongDatagrid.js +++ b/ui/src/common/SongDatagrid.js @@ -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' }, }))