Don't crash when using Player::PlayAt to play an index that doesn't exist. Fixes issue 2330

This commit is contained in:
David Sansome 2011-11-27 22:24:38 +00:00
parent 7548919bc1
commit be4e70a9b1
1 changed files with 5 additions and 0 deletions

View File

@ -302,6 +302,11 @@ void Player::PlayAt(int index, Engine::TrackChangeFlags change, bool reshuffle)
playlists_->active()->set_current_row(-1);
playlists_->active()->set_current_row(index);
if (playlists()->active()->current_row() == -1) {
// Maybe index didn't exist in the playlist.
return;
}
current_item_ = playlists_->active()->current_item();
const QUrl url = current_item_->Url();