Skip cards with empty names when loading xml (#6007)

This commit is contained in:
RickyRister 2025-06-25 06:21:17 -07:00 committed by GitHub
parent 4f1b4b1283
commit db55a2664f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -273,6 +273,11 @@ void CockatriceXml3Parser::loadCardsFromXml(QXmlStreamReader &xml)
}
}
if (name.isEmpty()) {
qCWarning(CockatriceXml3Log) << "Encountered card with empty name; skipping";
continue;
}
properties.insert("colors", colors);
CardInfoPtr newCard =
CardInfo::newInstance(name, text, isToken, properties, relatedCards, reverseRelatedCards, _sets, cipt,

View file

@ -252,6 +252,11 @@ void CockatriceXml4Parser::loadCardsFromXml(QXmlStreamReader &xml)
}
}
if (name.isEmpty()) {
qCWarning(CockatriceXml4Log) << "Encountered card with empty name; skipping";
continue;
}
CardInfoPtr newCard =
CardInfo::newInstance(name, text, isToken, properties, relatedCards, reverseRelatedCards, _sets, cipt,
landscapeOrientation, tableRow, upsideDown);