From: David Kastrup Date: Mon, 8 Feb 2016 22:47:47 +0000 (+0100) Subject: Issue 4767: Crash with Completion_heads_engraver and bare durations X-Git-Tag: release/2.19.37-1~16 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=0ab926218d76fa487f6935fd846796c902261e94;p=lilypond.git Issue 4767: Crash with Completion_heads_engraver and bare durations This checks for the existence of a pitch before using it, defaulting to middle C. --- diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index c88e4cccc1..34a985d32d 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -164,7 +164,7 @@ Completion_heads_engraver::make_note_head (Stream_event *ev) Item *note = make_item ("NoteHead", ev->self_scm ()); Pitch *pit = unsmob (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);