Skip to content

Commit

Permalink
Add handling for corrupted StaffTypeChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
mathesoncalum committed Jan 31, 2025
1 parent ea85076 commit d9669e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/engraving/rw/read400/tread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3638,7 +3638,12 @@ void TRead::read(Spacer* s, XmlReader& e, ReadContext& ctx)

void TRead::read(StaffType* t, XmlReader& e, ReadContext&)
{
t->setGroup(TConv::fromXml(e.asciiAttribute("group"), StaffGroup::STANDARD));
const AsciiStringView group = e.asciiAttribute("group");
IF_ASSERT_FAILED(!group.empty()) {
return;
}

t->setGroup(TConv::fromXml(group, StaffGroup::STANDARD));

if (t->group() == StaffGroup::TAB) {
t->setGenKeysig(false);
Expand Down
7 changes: 6 additions & 1 deletion src/engraving/rw/read410/tread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,12 @@ void TRead::read(Spacer* s, XmlReader& e, ReadContext& ctx)

void TRead::read(StaffType* t, XmlReader& e, ReadContext&)
{
t->setGroup(TConv::fromXml(e.asciiAttribute("group"), StaffGroup::STANDARD));
const AsciiStringView group = e.asciiAttribute("group");
IF_ASSERT_FAILED(!group.empty()) {
return;
}

t->setGroup(TConv::fromXml(group, StaffGroup::STANDARD));

if (t->group() == StaffGroup::TAB) {
t->setGenKeysig(false);
Expand Down

0 comments on commit d9669e1

Please sign in to comment.