From 5133dddf5c6561a4e1038ef935b5d8276ad6ccf3 Mon Sep 17 00:00:00 2001 From: Neil Puttock Date: Fri, 19 Jun 2009 23:26:29 +0100 Subject: [PATCH] Fix #781. - don't dereference non-existent event-cause, which may occur if the Ambitus_engraver is erroneously added to both the Staff and Voice contexts: in such a situation, Ambitus_engraver::acknowledge_note_head () will acknowledge an AmbitusNoteHead, which has no event-cause. --- lily/ambitus-engraver.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lily/ambitus-engraver.cc b/lily/ambitus-engraver.cc index 202e691d21..2585bd8bc1 100644 --- a/lily/ambitus-engraver.cc +++ b/lily/ambitus-engraver.cc @@ -121,15 +121,15 @@ void Ambitus_engraver::acknowledge_note_head (Grob_info info) { Stream_event *nr = info.event_cause (); - SCM p = nr->get_property ("pitch"); - /* - If the engraver is added to a percussion context, - filter out unpitched note heads. - */ - if (!unsmob_pitch (p)) - return; if (nr && nr->in_event_class ("note-event")) { + SCM p = nr->get_property ("pitch"); + /* + If the engraver is added to a percussion context, + filter out unpitched note heads. + */ + if (!unsmob_pitch (p)) + return; Pitch pitch = *unsmob_pitch (p); Drul_array expands = pitch_interval_.add_point (pitch); if (expands[UP]) -- 2.39.5