Skip to content

Commit

Permalink
Playlist: Check for valid index
Browse files Browse the repository at this point in the history
Fixes #1359
  • Loading branch information
jonaski committed Jan 19, 2024
1 parent 1a7194b commit 6a45968
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/playlist/playlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ bool Playlist::set_column_value(Song &song, Playlist::Column column, const QVari

QVariant Playlist::data(const QModelIndex &idx, int role) const {

if (!idx.isValid()) {
return QVariant();
}

switch (role) {
case Role_IsCurrent:
return current_item_index_.isValid() && idx.row() == current_item_index_.row();
Expand Down

0 comments on commit 6a45968

Please sign in to comment.