Skip to content

Commit

Permalink
Fix None type WikiNode error in Chinese translation extractor
Browse files Browse the repository at this point in the history
Check if the first template paramter of `trans-top` exists.
  • Loading branch information
xxyzz committed Nov 9, 2023
1 parent 3a26380 commit 2fff3e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wiktextract/extractor/zh/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def extract_translation(
template_name = child.template_name.lower()
if (
template_name in {"trans-top", "翻譯-頂", "trans-top-also"}
and len(child.template_parameters) > 0
and 1 in child.template_parameters
):
sense_text = clean_node(
wxr, None, child.template_parameters.get(1)
Expand Down

0 comments on commit 2fff3e1

Please sign in to comment.