]> git.donarmstrong.com Git - lilypond.git/commitdiff
only inspect 'element if it exists. Fixes #172
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 9 Dec 2006 11:42:07 +0000 (12:42 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 9 Dec 2006 11:47:05 +0000 (12:47 +0100)
lily/music-wrapper.cc

index 456af661cc339379d0e9d30150584be71002789c..051187a8a4215f6d3feb6e6e8cd2283526448d70 100644 (file)
@@ -25,6 +25,9 @@ Music_wrapper::length_callback (SCM m)
 {
   Music *me = unsmob_music (m);
   Music *elt = unsmob_music (me->get_property ("element"));
-  return elt->get_length ().smobbed_copy ();
+  if (elt)
+    return elt->get_length ().smobbed_copy ();
+  else
+    return Moment (0).smobbed_copy ();
 }