From 809e8ab1c7b7bbd9953f7d8428cdee2b1ac90101 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 15 Feb 2022 18:58:04 -0800 Subject: [PATCH] Add undefined check when decrementing song (#230) --- src/redux/playQueueSlice.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/redux/playQueueSlice.ts b/src/redux/playQueueSlice.ts index 8e34e2d..9c519b6 100644 --- a/src/redux/playQueueSlice.ts +++ b/src/redux/playQueueSlice.ts @@ -612,8 +612,8 @@ const playQueueSlice = createSlice({ } state.current = { ...state[currentEntry][state.currentIndex] }; - state.currentSongId = state[currentEntry][state.currentIndex].id; - state.currentSongUniqueId = state[currentEntry][state.currentIndex].uniqueId; + state.currentSongId = state[currentEntry][state.currentIndex]?.id; + state.currentSongUniqueId = state[currentEntry][state.currentIndex]?.uniqueId; } },