Do not attempt to add <br> if there is no HTML text

Happens for trace messages.
This commit is contained in:
Joerg Wunsch
2024-03-28 15:37:56 +01:00
parent f091a1d578
commit bc8f008105

View File

@@ -256,7 +256,7 @@ class adgui(QObject):
html = f"<font color={color}><strong>{s}</strong></font>"
elif level < ad.MSG_TRACE:
html = f"<font color={color}>{s}</font>"
if not no_nl or s[-1] == '\n':
if html and (not no_nl or s[-1] == '\n'):
html += "<br>\n"
if s != "" and s != "\n":
new_bol = not no_nl or (s[-1] == '\n')