diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2021-09-29 12:24:33 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2021-09-29 12:39:08 +0200 |
commit | 27be2267d2d58bc30cbde3b185662513e8bf74fb (patch) | |
tree | 1841060621b00426b87cdb3ab83b4973f3e9367f /src/track/beatmap.cpp | |
parent | beaf5250357d5fc0da1f40f2bdd21c3ca62ba283 (diff) |
Beats: Unify behavior of scale()/translate() operations
Do not return a nullptr to avoid unintended crashes!
Diffstat (limited to 'src/track/beatmap.cpp')
-rw-r--r-- | src/track/beatmap.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/track/beatmap.cpp b/src/track/beatmap.cpp index 5f80ddf435..fbf6ef493e 100644 --- a/src/track/beatmap.cpp +++ b/src/track/beatmap.cpp @@ -551,7 +551,7 @@ BeatsPointer BeatMap::translate(audio::FrameDiff_t offset) const { } BeatsPointer BeatMap::scale(BpmScale scale) const { - if (!isValid() || m_beats.isEmpty()) { + VERIFY_OR_DEBUG_ASSERT(isValid()) { return clone(); } @@ -599,8 +599,8 @@ BeatsPointer BeatMap::scale(BpmScale scale) const { } BeatsPointer BeatMap::setBpm(mixxx::Bpm bpm) const { - if (!isValid()) { - return {}; + VERIFY_OR_DEBUG_ASSERT(bpm.isValid()) { + return clone(); } const auto firstBeatPosition = mixxx::audio::FramePos(m_beats.first().frame_position()); |