Fix null album/artist navigation

Adds a check before trying to navigate to album/artist page
This commit is contained in:
jeffvli
2021-09-21 07:39:12 -07:00
parent 9cfd152851
commit e1998970e8

View File

@@ -406,15 +406,21 @@ const PlayerBar = () => {
>
<LinkButton
tabIndex={0}
onClick={() =>
history.push(
`/library/album/${
playQueue[currentEntryList][
playQueue.currentIndex
]?.albumId
}`
)
}
onClick={() => {
if (
playQueue[currentEntryList][
playQueue.currentIndex
]?.albumId
) {
history.push(
`/library/album/${
playQueue[currentEntryList][
playQueue.currentIndex
]?.albumId
}`
);
}
}}
>
{playQueue[currentEntryList][playQueue.currentIndex]
?.title || 'Unknown title'}
@@ -448,13 +454,19 @@ const PlayerBar = () => {
tabIndex={0}
subtitle="true"
onClick={() => {
history.push(
`/library/artist/${
playQueue[currentEntryList][
playQueue.currentIndex
]?.artistId
}`
);
if (
playQueue[currentEntryList][
playQueue.currentIndex
]?.artistId
) {
history.push(
`/library/artist/${
playQueue[currentEntryList][
playQueue.currentIndex
]?.artistId
}`
);
}
}}
>
{playQueue[currentEntryList][playQueue.currentIndex]