From 8e4ff5f69db5170a881ddff8e7ecb0b5d85a59d5 Mon Sep 17 00:00:00 2001 From: Knute Snortum Date: Fri, 6 Feb 2026 09:42:16 -0800 Subject: [PATCH] Check that list is not empty before working on it. Fixes #1712 --- ly/musicxml/ly2xml_mediator.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ly/musicxml/ly2xml_mediator.py b/ly/musicxml/ly2xml_mediator.py index e67004e0..037c4aed 100644 --- a/ly/musicxml/ly2xml_mediator.py +++ b/ly/musicxml/ly2xml_mediator.py @@ -294,11 +294,12 @@ def check_part(self): def check_simultan(self): """Check done after simultanoues (<< >>) section.""" - if self.part: - self.part.merge_voice(self.sections[-1]) - elif len(self.sections)>1: - self.sections[-2].merge_voice(self.sections[-1]) - self.sections.pop() + if self.sections: + if self.part: + self.part.merge_voice(self.sections[-1]) + elif len(self.sections)>1: + self.sections[-2].merge_voice(self.sections[-1]) + self.sections.pop() def check_score(self): """