]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4767: Crash with Completion_heads_engraver and bare durations
authorDavid Kastrup <dak@gnu.org>
Mon, 8 Feb 2016 22:47:47 +0000 (23:47 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 15 Feb 2016 19:30:34 +0000 (20:30 +0100)
This checks for the existence of a pitch before using it, defaulting
to middle C.

lily/completion-note-heads-engraver.cc

index c88e4cccc1e8f6f391937e9a87cca340a1ab6a06..34a985d32da3cd1b16f2dda5e7bb2ff5a93fd5b2 100644 (file)
@@ -164,7 +164,7 @@ Completion_heads_engraver::make_note_head (Stream_event *ev)
   Item *note = make_item ("NoteHead", ev->self_scm ());
   Pitch *pit = unsmob<Pitch> (ev->get_property ("pitch"));
 
-  int pos = pit->steps ();
+  int pos = pit ? pit->steps () : 0;
   SCM c0 = get_property ("middleCPosition");
   if (scm_is_number (c0))
     pos += scm_to_int (c0);