Guard against nil in "time to empty/full"

This commit is contained in:
Stefano Mazzucco 2019-11-11 00:35:18 +00:00
parent 4f0f674771
commit 1826fdcea9
1 changed files with 3 additions and 1 deletions

View File

@ -76,8 +76,10 @@ function widget:update()
what = "Full"
when = self.device.TimeToFull
end
if when then
charge_status_msg = string.format("\n%s in %s", what, to_hour_min_str(when))
end
end
self.tooltip:set_text(
string.format(