diff --git a/filechooser.lua b/filechooser.lua index f8fffff10..5d0c1b859 100644 --- a/filechooser.lua +++ b/filechooser.lua @@ -56,9 +56,9 @@ end function BatteryLevel() -- NuPogodi, 18.05.12: This command seems to work even without Amazon Kindle framework - local cmd="gasgauge-info -s 2> /dev/null" - local p = assert(io.popen(cmd, "r")) - local battery = assert(p:read("*a")) + local p = io.popen("gasgauge-info -s 2> /dev/null", "r") -- io.popen() _never_ fails! + local battery = p:read("*a") or "?" + if battery == "" then battery = "?" end p:close() return string.gsub(battery, "[\n\r]+", "") end