File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -312,10 +312,16 @@ RetVal<muse::midi::tick_t> NotationPlayback::playPositionTickByElement(const Eng
312312
313313void NotationPlayback::addLoopBoundary (LoopBoundaryType boundaryType, tick_t tick)
314314{
315+ const Measure* first = score ()->firstMeasure ();
316+ const Measure* last = score ()->lastMeasure ();
317+ IF_ASSERT_FAILED (first && last) {
318+ return ;
319+ }
320+
315321 if (tick == BoundaryTick::FirstScoreTick) {
316- tick = score ()-> firstMeasure () ->tick ().ticks ();
322+ tick = first ->tick ().ticks ();
317323 } else if (tick == BoundaryTick::LastScoreTick) {
318- tick = score ()-> lastMeasure () ->endTick ().ticks ();
324+ tick = last ->endTick ().ticks ();
319325 }
320326
321327 switch (boundaryType) {
Original file line number Diff line number Diff line change 2525
2626#include " playbacktypes.h"
2727
28+ #include " engraving/dom/masterscore.h"
2829#include " engraving/dom/stafftext.h"
2930#include " engraving/dom/utils.h"
3031#include " engraving/dom/factory.h"
@@ -900,6 +901,12 @@ void PlaybackController::toggleLoopPlayback()
900901 return ;
901902 }
902903
904+ const MasterScore* score = m_masterNotation ? m_masterNotation->masterScore () : nullptr ;
905+ const Measure* first = score ? score->firstMeasure () : nullptr ;
906+ if (!first) {
907+ return ;
908+ }
909+
903910 if (loopBoundariesSet () && !selection ()->isRange ()) {
904911 enableLoop ();
905912 return ;
You can’t perform that action at this time.
0 commit comments