fix: Handle nil values for time and color in dashboard display
This commit is contained in:
@@ -181,10 +181,10 @@ local function drawDashboard()
|
|||||||
monitor.clearLine()
|
monitor.clearLine()
|
||||||
|
|
||||||
monitor.setTextColor(colors.darkGray)
|
monitor.setTextColor(colors.darkGray)
|
||||||
local time = os.date("%H:%M:%S", entry.time / 1000)
|
local time = os.date("%H:%M:%S", (entry.time or 0) / 1000)
|
||||||
monitor.write(time .. " ")
|
monitor.write(time .. " ")
|
||||||
|
|
||||||
monitor.setTextColor(entry.color)
|
monitor.setTextColor(entry.color or colors.white)
|
||||||
local maxWidth = w - 10
|
local maxWidth = w - 10
|
||||||
local text = entry.text
|
local text = entry.text
|
||||||
if #text > maxWidth then
|
if #text > maxWidth then
|
||||||
|
|||||||
Reference in New Issue
Block a user