summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2011-05-22 14:56:52 +0000
committerRobert Jonsson <spamatica@gmail.com>2011-05-22 14:56:52 +0000
commit44e32358acdd41f03c24d59e7764913c86196b9e (patch)
treee2cddfe83a0fea80756c3d4efd7c28a28dabd1e8
parentc3d2b8170870d7c0025d902b675fac417019aa7b (diff)
fixed crash when skipping selection in clef menu
-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;
}