Skip to content

Commit db74d32

Browse files
committed
Check for key in style before accessing.
1 parent 603ebb4 commit db74d32

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

typescript/libs/popup_formatter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ def format_css(style):
66
"""
77
result = ""
88

9-
if (style["foreground"]):
9+
if ("foreground" in style and style["foreground"]):
1010
result += "color: {0};".format(style["foreground"])
1111

12-
if (style["bold"]):
12+
if ("bold" in style and style["bold"]):
1313
result += "font-weight: bold;"
1414

15-
if (style["italic"]):
15+
if ("italic" in style and style["italic"]):
1616
result += "font-style: italic;"
1717

1818
return result

0 commit comments

Comments
 (0)