]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #781.
authorNeil Puttock <n.puttock@gmail.com>
Fri, 19 Jun 2009 22:26:29 +0000 (23:26 +0100)
committerPatrick McCarty <pnorcks@gmail.com>
Fri, 17 Jul 2009 09:50:11 +0000 (02:50 -0700)
- 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.
(cherry picked from commit d511b69c1cb8836bc0b7b49b9f396cf06fef19ac)

lily/ambitus-engraver.cc

index 202e691d21d6515060cad0b0325fecc7af781200..2585bd8bc1c0fe00f9f55a85232e97ecb82cc7c1 100644 (file)
@@ -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<bool> expands = pitch_interval_.add_point (pitch);
       if (expands[UP])