Skip to content

Commit

Permalink
(fix) Track menu: avoid crash with track nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Sep 22, 2024
1 parent fbaff06 commit be3ce61
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/widget/wtrackmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,13 +968,15 @@ void WTrackMenu::updateMenus() {
} else if (m_pTrack) {
pTrack = m_pTrack;
}
const double bpm = pTrack->getBpm();
appendBpmPreviewtoBpmAction(m_pBpmDoubleAction, bpm);
appendBpmPreviewtoBpmAction(m_pBpmHalveAction, bpm);
appendBpmPreviewtoBpmAction(m_pBpmTwoThirdsAction, bpm);
appendBpmPreviewtoBpmAction(m_pBpmThreeFourthsAction, bpm);
appendBpmPreviewtoBpmAction(m_pBpmFourThirdsAction, bpm);
appendBpmPreviewtoBpmAction(m_pBpmThreeHalvesAction, bpm);
if (pTrack) {
const double bpm = pTrack->getBpm();
appendBpmPreviewtoBpmAction(m_pBpmDoubleAction, bpm);
appendBpmPreviewtoBpmAction(m_pBpmHalveAction, bpm);
appendBpmPreviewtoBpmAction(m_pBpmTwoThirdsAction, bpm);
appendBpmPreviewtoBpmAction(m_pBpmThreeFourthsAction, bpm);
appendBpmPreviewtoBpmAction(m_pBpmFourThirdsAction, bpm);
appendBpmPreviewtoBpmAction(m_pBpmThreeHalvesAction, bpm);
}
}
}
}
Expand Down

0 comments on commit be3ce61

Please sign in to comment.