]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #383.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 23 Jun 2007 20:45:16 +0000 (17:45 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 23 Jun 2007 20:45:16 +0000 (17:45 -0300)
Checks for stem == NULL.

input/regression/tuplet-no-stems.ly [new file with mode: 0644]
lily/tuplet-bracket.cc

diff --git a/input/regression/tuplet-no-stems.ly b/input/regression/tuplet-no-stems.ly
new file mode 100644 (file)
index 0000000..c15a3b2
--- /dev/null
@@ -0,0 +1,28 @@
+\header{
+  texidoc = "Removing Stem_engraver doesn't cause crashes."
+}
+
+
+\version "2.10.27"
+
+\layout{
+ \context{
+   \TabStaff
+   \override TimeSignature #'stencil = ##f
+ }
+ \context{
+   \TabVoice
+   \remove Beam_engraver
+   \remove Stem_engraver
+   \override TupletBracket #'number-visibility = ##f
+ }
+}
+
+partition = {
+    \times 2/3 { f8 g a }
+}
+
+
+\new TabStaff {
+    \partition
+}
index 06411f72f2885a620fa85fad149dfd527820cf0f..b27c783208291ff2b29311e06b39ebf3f926fbbf 100644 (file)
@@ -91,8 +91,10 @@ Tuplet_bracket::parallel_beam (Grob *me_grob, vector<Grob*> const &cols,
   Drul_array<Grob*> stems (Note_column::get_stem (cols[0]),
                           Note_column::get_stem (cols.back ()));
 
-  if (dynamic_cast<Item*> (stems[RIGHT])->get_column ()
-      != me->get_bound (RIGHT)->get_column ())
+  if (!stems[RIGHT]
+      || !stems[LEFT]
+      || (dynamic_cast<Item*> (stems[RIGHT])->get_column ()
+         != me->get_bound (RIGHT)->get_column ()))
     return 0;
 
   Drul_array<Grob*> beams;
@@ -759,6 +761,9 @@ Tuplet_bracket::calc_cross_staff (SCM smob)
   for (vsize i = 0; i < cols.size (); i++)
     {
       Grob *stem = unsmob_grob (cols[i]->get_object ("stem"));
+      if (!stem)
+       continue;
+      
       if (to_boolean (stem->get_property ("cross-staff")))
        return SCM_BOOL_T;