From af125b324e4ba5f7bd90dbe4202464594afcea4e Mon Sep 17 00:00:00 2001 From: Luca CPZ <1777696+lcpz@users.noreply.github.com> Date: Fri, 17 Apr 2020 20:25:55 -0500 Subject: [PATCH] Update bat.lua Ensure that status is never nil. Closes #451 --- widget/bat.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widget/bat.lua b/widget/bat.lua index 3cb801c..3310069 100644 --- a/widget/bat.lua +++ b/widget/bat.lua @@ -136,7 +136,7 @@ local function factory(args) -- "Full", "Unknown" or "Charging". When the laptop is not plugged in, -- one or more of the batteries may be full, but only one battery -- discharging suffices to set global status to "Discharging". - bat_now.status = bat_now.n_status[1] + bat_now.status = bat_now.n_status[1] or "N/A" for _,status in ipairs(bat_now.n_status) do if status == "Discharging" or status == "Charging" then bat_now.status = status