From 9079cc40eb8828c32a6b838d6994e45de2c6e137 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Fri, 5 Feb 2021 14:16:28 +0100 Subject: [PATCH] Make HandleModifier() fail gracefully when not finding a matching event --- src/SymbolHandler.mss | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/SymbolHandler.mss b/src/SymbolHandler.mss index 47c2745..57ce0d0 100644 --- a/src/SymbolHandler.mss +++ b/src/SymbolHandler.mss @@ -152,17 +152,16 @@ function HandleModifier(this, sobj, template){ if (nobj != null) { modifier = MeiFactory(template); - libmei.AddChild(nobj, modifier); + return modifier; } else { warnings = Self._property:warnings; - warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, bar.BarNumber, voicenum, sobj.Name)); + barNum = sobj.ParentBar.BarNumber; + voiceNum = sobj.VoiceNumber; + warnings.Push(utils.Format(_ObjectCouldNotFindAttachment, barNum, voiceNum, sobj.Name)); } - - return modifier; - } //$end function HandleControlEvent(this, sobj, template){