Skip to content

Commit

Permalink
fix: 播放列表为空时提示错误
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden committed Nov 8, 2021
1 parent ff1f278 commit ee24087
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/background/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export async function changePlaylist (playlistId) {
const songsIndex = store.playMode === PLAY_MODE.SHUFFLE ? selectedPlaylist.shuffleIndexes : selectedPlaylist.normalIndexes
songId = songsIndex[0]
}
if (!songId) {
throw new Error('播放列表为空')
}
loadAndPlaySong(selectedPlaylist, songId)
.then(({ selectedSong }) => {
sendToPopup({ topic: 'sync', change: { selectedSong } })
Expand Down

0 comments on commit ee24087

Please sign in to comment.