From 57dee4c91b0941faf60b0535cc86cd28c0e8e3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albin=20Wahl=C3=A9n?= <63047114+wahlencraft@users.noreply.github.com> Date: Sat, 26 Mar 2022 18:58:50 +0100 Subject: [PATCH] Fix temp widget show N/A when no sensor found (#528) --- widget/temp.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/widget/temp.lua b/widget/temp.lua index bafdcdc..f267283 100644 --- a/widget/temp.lua +++ b/widget/temp.lua @@ -32,7 +32,11 @@ local function factory(args) temp_now[t] = temp_value and temp_value/1e3 or temp_fl end end - coretemp_now = string.format(format, temp_now[tempfile]) or "N/A" + if temp_now[tempfile] then + coretemp_now = string.format(format, temp_now[tempfile]) + else + coretemp_now = "N/A" + end widget = temp.widget settings() end)