diff --git a/src/widget/wtracktableview.cpp b/src/widget/wtracktableview.cpp index 81d022e7911..74f400a92c5 100644 --- a/src/widget/wtracktableview.cpp +++ b/src/widget/wtracktableview.cpp @@ -571,11 +571,9 @@ void WTrackTableView::slotMouseDoubleClicked(const QModelIndex &index) { } TrackPointer pTrack = trackModel->getTrack(index); - VERIFY_OR_DEBUG_ASSERT(pTrack) { - return; + if (pTrack) { + emit loadTrack(pTrack); } - - emit(loadTrack(pTrack)); } else if (doubleClickAction == DlgPrefLibrary::ADD_TO_AUTODJ_BOTTOM && modelHasCapabilities(TrackModel::TRACKMODELCAPS_ADDTOAUTODJ)) { sendToAutoDJ(PlaylistDAO::AutoDJSendLoc::BOTTOM); @@ -1811,13 +1809,11 @@ void WTrackTableView::slotScaleBpm(int scale) { QModelIndexList selectedTrackIndices = selectionModel()->selectedRows(); for (const auto& index : selectedTrackIndices) { - TrackPointer track = trackModel->getTrack(index); - if (!track->isBpmLocked()) { // bpm is not locked - BeatsPointer beats = track->getBeats(); - if (beats != nullptr) { - beats->scale(static_cast(scale)); - } else { - continue; + TrackPointer pTrack = trackModel->getTrack(index); + if (pTrack && !pTrack->isBpmLocked()) { + BeatsPointer pBeats = pTrack->getBeats(); + if (pBeats) { + pBeats->scale(static_cast(scale)); } } } @@ -1832,8 +1828,10 @@ void WTrackTableView::lockBpm(bool lock) { QModelIndexList selectedTrackIndices = selectionModel()->selectedRows(); // TODO: This should be done in a thread for large selections for (const auto& index : selectedTrackIndices) { - TrackPointer track = trackModel->getTrack(index); - track->setBpmLocked(lock); + TrackPointer pTrack = trackModel->getTrack(index); + if (pTrack) { + pTrack->setBpmLocked(lock); + } } } @@ -1846,9 +1844,9 @@ void WTrackTableView::slotClearBeats() { QModelIndexList selectedTrackIndices = selectionModel()->selectedRows(); // TODO: This should be done in a thread for large selections for (const auto& index : selectedTrackIndices) { - TrackPointer track = trackModel->getTrack(index); - if (!track->isBpmLocked()) { - track->setBeats(BeatsPointer()); + TrackPointer pTrack = trackModel->getTrack(index); + if (pTrack && !pTrack->isBpmLocked()) { + pTrack->setBeats(BeatsPointer()); } } }