modules/admin-full: fix possible error in led page
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 9 May 2011 12:51:01 +0000 (12:51 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 9 May 2011 12:51:01 +0000 (12:51 +0000)
modules/admin-full/luasrc/model/cbi/admin_system/leds.lua

index 053a5de..b912f5e 100644 (file)
@@ -121,8 +121,8 @@ end
 
 for p in nixio.fs.glob("/sys/bus/usb/devices/[0-9]*/manufacturer") do
        local id = p:match("%d+-%d+")
 
 for p in nixio.fs.glob("/sys/bus/usb/devices/[0-9]*/manufacturer") do
        local id = p:match("%d+-%d+")
-       local mf = nixio.fs.readfile("/sys/bus/usb/devices/" .. id .. "/manufacturer")
-       local pr = nixio.fs.readfile("/sys/bus/usb/devices/" .. id .. "/product")
+       local mf = nixio.fs.readfile("/sys/bus/usb/devices/" .. id .. "/manufacturer") or "?"
+       local pr = nixio.fs.readfile("/sys/bus/usb/devices/" .. id .. "/product")      or "?"
        usbdev:value(id, "%s (%s - %s)" %{ id, mf, pr })
 end
 
        usbdev:value(id, "%s (%s - %s)" %{ id, mf, pr })
 end