mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 19:45:31 +01:00
Fix crash when trying to download a track, but there is no current one playing.
This commit is contained in:
parent
30346e7810
commit
c9b39e7c83
@ -64,15 +64,23 @@ SongSender::~SongSender() {
|
||||
}
|
||||
|
||||
void SongSender::SendSongs(const pb::remote::RequestDownloadSongs& request) {
|
||||
Song current_song = app_->player()->GetCurrentItem()->Metadata();
|
||||
Song current_song;
|
||||
if (app_->player()->GetCurrentItem()) {
|
||||
current_song = app_->player()->GetCurrentItem()->Metadata();
|
||||
}
|
||||
|
||||
switch (request.download_item()) {
|
||||
case pb::remote::CurrentItem: {
|
||||
DownloadItem item(current_song, 1, 1);
|
||||
download_queue_.append(item);
|
||||
if (current_song.is_valid()) {
|
||||
DownloadItem item(current_song, 1, 1);
|
||||
download_queue_.append(item);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case pb::remote::ItemAlbum:
|
||||
SendAlbum(current_song);
|
||||
if (current_song.is_valid()) {
|
||||
SendAlbum(current_song);
|
||||
}
|
||||
break;
|
||||
case pb::remote::APlaylist:
|
||||
SendPlaylist(request.playlist_id());
|
||||
|
Loading…
x
Reference in New Issue
Block a user