Skip to content

Commit

Permalink
Update bat.lua
Browse files Browse the repository at this point in the history
Ensure that status is never nil. Closes #451
  • Loading branch information
lcpz authored Apr 18, 2020
1 parent 33c0e0c commit af125b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion widget/bat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit af125b3

Please sign in to comment.