From 17dd34fba0bea779168c8b1f9346438abfc8248e Mon Sep 17 00:00:00 2001
From: Reinhold Kainhofer <reinhold@kainhofer.com>
Date: Wed, 19 Dec 2007 23:28:24 +0100
Subject: [PATCH] Partcombine: Fix crash when empty music is passed

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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scm/part-combiner.scm b/scm/part-combiner.scm
index 81c6e36850..2f4d37a434 100644
--- a/scm/part-combiner.scm
+++ b/scm/part-combiner.scm
@@ -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)
-- 
2.39.5