Skip to content

Commit aa0979a

Browse files
committed
fix: catches bug caused by empty <trackName> tags in the instrumentation header of a MuseScore file
1 parent 99f47b8 commit aa0979a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ms3/bs4_parser.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3754,7 +3754,8 @@ def soup_references(self) -> dict[str, dict[str, bs4.Tag]]:
37543754
if name == "trackName" and (
37553755
tag is None or tag.get_text() == ""
37563756
): # this corresponds to the current behaviour of bs4_parser.get_part_info
3757-
instrument_tag.trackName.string = part.trackName.string
3757+
part_trackName = part.trackName.string
3758+
instrument_tag.trackName.string = part_trackName if part_trackName else ""
37583759
tag = instrument_tag.find(name)
37593760
cur_dict[name] = tag
37603761
tag_dict.update(

0 commit comments

Comments
 (0)