Merge pull request #71 from andyhelp/master
batteryarc-widget: fix crash when battery is not available
This commit is contained in:
commit
f24cbb9fa5
|
@ -75,7 +75,9 @@ watch("acpi -i", 10,
|
||||||
|
|
||||||
charge = charge + batt.charge * capacities[i]
|
charge = charge + batt.charge * capacities[i]
|
||||||
end
|
end
|
||||||
charge = charge / capacity
|
if capacity > 0 then
|
||||||
|
charge = charge / capacity
|
||||||
|
end
|
||||||
|
|
||||||
widget.value = charge / 100
|
widget.value = charge / 100
|
||||||
if status == 'Charging' then
|
if status == 'Charging' then
|
||||||
|
|
Loading…
Reference in New Issue