From 730f7335fa3cd6cae1d3c1ed7f84e92734db7959 Mon Sep 17 00:00:00 2001 From: Binrui Dong Date: Sat, 13 Apr 2024 14:52:41 +0800 Subject: [PATCH] Properly handle default_clause without text in translation string extractor --- lang/string_extractor/parsers/widget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/string_extractor/parsers/widget.py b/lang/string_extractor/parsers/widget.py index bd01973ef1cc3..65d2c83e82d99 100644 --- a/lang/string_extractor/parsers/widget.py +++ b/lang/string_extractor/parsers/widget.py @@ -17,7 +17,7 @@ def parse_widget(json, origin): comment = "Text in portion of UI widget \"{}\"".format(id) if "text" in phrase: write_text(phrase["text"], origin, comment=comment) - if "default_clause" in json: + if "default_clause" in json and "text" in json["default_clause"]: write_text(json["default_clause"]["text"], origin, comment="Default clause of UI widget \"{}\"".format(id)) if "clauses" in json: