]> git.donarmstrong.com Git - lilypond.git/commitdiff
Partcombine: Fix crash when empty music is passed
authorReinhold Kainhofer <reinhold@kainhofer.com>
Wed, 19 Dec 2007 22:28:24 +0000 (23:28 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Mon, 4 Feb 2008 16:24:34 +0000 (17:24 +0100)
I usually start with the general structure of a large score
and only then fill it with music. This means that partcombine
is fed two empty music expressions (or only containing one
multi-measure rest each), so that evs1 and evs2 won't contain
data and (assoc "one" evs1) will be an empty list => cdr on
it will crash.
In this case, simply set the split list to an empty list and
don't crash...

Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
scm/part-combiner.scm

index 81c6e3685075ffcd7fce1be946ebcf7da1ee5830..2f4d37a434b784cc231956aaae056cbc96688240 100644 (file)
@@ -230,8 +230,10 @@ Voice-state objects
     
     (set! (ly:music-property m 'elements) (list m1 m2))
     (set! (ly:music-property m 'split-list)
-         (determine-split-list (reverse! (cdr (assoc "one" evs1)) '())
-                               (reverse! (cdr (assoc "two" evs2)) '())))
+      (if (and (assoc "one" evs1) (assoc "two" evs2))
+         (determine-split-list (reverse! (cdr (assoc "one" evs1)) '())
+                               (reverse! (cdr (assoc "two" evs2)) '()))
+         '() ))
     m))
 
 (define-public (determine-split-list evl1 evl2)