Safely handling non-result responses from Genius (for lyrics)
This commit is contained in:
@ -258,7 +258,9 @@ export function findTrackLyrics(uri) {
|
||||
|
||||
// Immediately go and get the first result's lyrics
|
||||
const lyrics_result = lyrics_results[0];
|
||||
dispatch(getTrackLyrics(track.uri, lyrics_result.path));
|
||||
if (lyrics_result) {
|
||||
dispatch(getTrackLyrics(track.uri, lyrics_result.path));
|
||||
}
|
||||
}
|
||||
dispatch(uiActions.stopLoading(loader_key));
|
||||
},
|
||||
|
||||
@ -106,7 +106,7 @@ const KioskMode = () => {
|
||||
if (current_track.lyrics) return;
|
||||
|
||||
// We got results, but failed to load the lyrics, so re-try
|
||||
if (current_track.lyrics_results && current_track.lyrics === null) {
|
||||
if (current_track?.lyrics_results && current_track.lyrics === null) {
|
||||
dispatch(geniusActions.getTrackLyrics(current_track.uri, current_track.path));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user