CommonClient: fix color related crashes in --nogui mode

This commit is contained in:
Fabian Dill
2022-01-25 02:25:20 +01:00
parent ea0ff6cbf7
commit 0800cfccb6
2 changed files with 1 additions and 9 deletions

View File

@@ -194,7 +194,7 @@ class JSONtoTextParser(metaclass=HandlerMeta):
def _handle_color(self, node: JSONMessagePart):
codes = node["color"].split(";")
buffer = "".join(color_code(code) for code in codes)
buffer = "".join(color_code(code) for code in codes if code in color_codes)
return buffer + self._handle_text(node) + color_code("reset")
def _handle_text(self, node: JSONMessagePart):