From 653143b448f8500c4bb4d3b6c79e36d3d418af58 Mon Sep 17 00:00:00 2001 From: Hans-Werner Hilse Date: Wed, 4 Jun 2014 15:38:12 +0200 Subject: [PATCH] fail gracefully when the Kobo light device cannot be opened --- frontend/ui/device/kobopowerd.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/ui/device/kobopowerd.lua b/frontend/ui/device/kobopowerd.lua index 5ed20dc9b..c72020ed6 100644 --- a/frontend/ui/device/kobopowerd.lua +++ b/frontend/ui/device/kobopowerd.lua @@ -13,7 +13,8 @@ local KoboPowerD = BasePowerD:new{ } function KoboPowerD:init() - self.fl = kobolight.open() + local ok, light = pcall(kobolight.open) + if ok then self.fl = light end end function KoboPowerD:toggleFrontlight()