summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2021-11-20 20:05:08 +0100
committerache <ache@ache.one>2021-11-20 20:05:08 +0100
commit3a21251b15df0c26e725fad8a0f67663f232af2d (patch)
tree827c1cc3a76248edddb95520d3dc25dcc5be6171
parentUpdate Wifi signal (diff)
Fix use before check null error
-rw-r--r--rc.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/rc.lua b/rc.lua
index d4aa847..999d1f6 100644
--- a/rc.lua
+++ b/rc.lua
@@ -326,8 +326,8 @@ function act()
awful.spawn.easy_async("bash -c \"acpi | cut -d',' -f2 \"",
function(percent, stderr, reason, exit_code)
a, b = string.find( percent, "%%")
- nPercent = tonumber(string.sub(percent,2,a-1))
if a then
+ nPercent = tonumber(string.sub(percent,2,a-1))
mybatwidget:set_text ("🔌 " .. nPercent .. "%")
end
end)