summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
Diffstat (limited to 'muse2')
-rw-r--r--muse2/muse/arranger/tlist.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp
index 427047c2..6fea279a 100644
--- a/muse2/muse/arranger/tlist.cpp
+++ b/muse2/muse/arranger/tlist.cpp
@@ -1076,18 +1076,20 @@ void TList::mousePressEvent(QMouseEvent* ev)
// Show the menu
QAction* act = p->exec(ev->globalPos(), 0);
- switch (act->data().toInt()) {
- case 0:
- ((MidiTrack*)t)->setClef(ScoreEdit::trebleClef);
- break;
- case 1:
- ((MidiTrack*)t)->setClef(ScoreEdit::bassClef);
- break;
- case 2:
- ((MidiTrack*)t)->setClef(ScoreEdit::grandStaff);
- break;
- default:
- break;
+ if (act) {
+ switch (act->data().toInt()) {
+ case 0:
+ ((MidiTrack*)t)->setClef(ScoreEdit::trebleClef);
+ break;
+ case 1:
+ ((MidiTrack*)t)->setClef(ScoreEdit::bassClef);
+ break;
+ case 2:
+ ((MidiTrack*)t)->setClef(ScoreEdit::grandStaff);
+ break;
+ default:
+ break;
+ }
}
delete p;
}