Add fallback type_line handling (#313)
Some checks failed
Deploy / Check for new spoiler (push) Has been cancelled

Handle missing type_line in spoiler cards.
This commit is contained in:
tooomm
2025-11-25 16:57:33 +01:00
committed by GitHub
parent 2f23aa93c6
commit 1060f659a5

View File

@@ -153,7 +153,10 @@ def build_types(sf_card: Dict[str, Any]) -> Tuple[List[str], str, List[str]]:
super_types: List[str] = []
sub_types: List[str] = []
type_line = sf_card["type_line"]
# Spoiler cards do not always include a type_line
type_line = sf_card.get("type_line", "")
if not type_line:
type_line = "Unknown"
if "" in type_line:
card_subs = type_line.split("")[1].strip()