PlaylistListView: Check for valid current index

This commit is contained in:
Jonas Kvinge
2025-05-13 19:42:25 +02:00
parent 65e960f2c5
commit 349ab62e75

View File

@@ -125,7 +125,9 @@ void PlaylistListView::timerEvent(QTimerEvent *e) {
QTreeView::timerEvent(e);
if (e->timerId() == drag_hover_timer_.timerId()) {
drag_hover_timer_.stop();
Q_EMIT doubleClicked(currentIndex());
if (currentIndex().isValid()) {
Q_EMIT doubleClicked(currentIndex());
}
}
}
@@ -136,7 +138,9 @@ void PlaylistListView::dropEvent(QDropEvent *e) {
if (drag_hover_timer_.isActive()) {
drag_hover_timer_.stop();
}
Q_EMIT ItemMimeDataDroppedSignal(currentIndex(), e->mimeData());
if (currentIndex().isValid()) {
Q_EMIT ItemMimeDataDroppedSignal(currentIndex(), e->mimeData());
}
}
else {
AutoExpandingTreeView::dropEvent(e);