From ed0982a8325c9cf80489216847a312269564890f Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Tue, 5 Jul 2022 11:18:07 -0400 Subject: [PATCH] handle nil tag color --- scada-common/log.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scada-common/log.lua b/scada-common/log.lua index 0c6ae89..7689340 100644 --- a/scada-common/log.lua +++ b/scada-common/log.lua @@ -150,10 +150,10 @@ function log.dmesg(msg, tag, tag_color) out.setTextColor(colors.white) out.write("] ") - -- colored tag + -- print optionally colored tag if tag ~= "" then out.write("[") - out.setTextColor(tag_color) + if tag_color then out.setTextColor(tag_color) end out.write(tag) out.setTextColor(colors.white) out.write("] ")