Skip to content

Commit 87f9508

Browse files
committed
Fix nil value emergence
1 parent 5a83517 commit 87f9508

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cpu_rings.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,14 @@ end
161161
function conky_clock_rings()
162162
local function setup_rings(cr,pt)
163163
local str=''
164-
local value=0
164+
local value=1
165165

166166
str=string.format('${%s %s}',pt['name'],pt['arg'])
167167
str=conky_parse(str)
168168

169-
value=tonumber(str)
169+
if(str ~= '') then
170+
value=tonumber(str)
171+
end
170172
pct=value/pt['max']
171173

172174
draw_ring(cr,pct,pt)

0 commit comments

Comments
 (0)