Skip to content

Commit

Permalink
fix(downloads): Prevent null error when updating songs when songlist …
Browse files Browse the repository at this point in the history
…screen was loaded.
  • Loading branch information
sampie777 committed Dec 13, 2021
1 parent b46d1e3 commit 47f2b25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/scripts/songs/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ function generateSongTitleVersesString(selectedVerses: Array<Verse>) {
}

export const generateSongTitle = (song?: Song, selectedVerses?: Array<Verse>): string => {
if (song === undefined) {
if (song === undefined || song === null) {
return "";
}

if (selectedVerses === undefined || selectedVerses.length === 0) {
if (selectedVerses === undefined || selectedVerses === null || selectedVerses.length === 0) {
return song.name;
}

Expand Down

0 comments on commit 47f2b25

Please sign in to comment.