Skip to content

Commit

Permalink
Fix crash on lasso selection
Browse files Browse the repository at this point in the history
In the case of a lasso selection, `interaction->selection()->element()` is (or can be) nullptr.
  • Loading branch information
cbjeukendrup committed Jan 10, 2025
1 parent dc3e199 commit 9389966
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/notation/view/notationviewinputcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,10 +908,16 @@ void NotationViewInputController::mouseReleaseEvent(QMouseEvent* event)
m_isCanvasDragged = false;

if (interaction->isDragStarted()) {
bool isDraggingHairpinSegmentGrip
= interaction->isGripEditStarted()
&& interaction->selection()->element()
&& interaction->selection()->element()->isHairpinSegment();

interaction->endDrag();

// When dragging of hairpin ends on a note or rest, open dynamic popup
// Check for note or rest happens in Score::addText which is called through addTextToItem in toggleDynamicPopup
if (interaction->selection()->element()->isHairpinSegment()) {
if (isDraggingHairpinSegmentGrip) {
interaction->toggleDynamicPopup();
}
}
Expand Down

0 comments on commit 9389966

Please sign in to comment.