From 44e32358acdd41f03c24d59e7764913c86196b9e Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Sun, 22 May 2011 14:56:52 +0000 Subject: fixed crash when skipping selection in clef menu --- muse2/muse/arranger/tlist.cpp | 26 ++++++++++++++------------ 1 file 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; } -- cgit v1.2.3