Backport luci-base: filter invalid opkg status lines
authorHannu Nyman <hannu.nyman@iki.fi>
Sat, 24 Oct 2015 06:40:55 +0000 (09:40 +0300)
committerHannu Nyman <hannu.nyman@iki.fi>
Sat, 24 Oct 2015 06:40:55 +0000 (09:40 +0300)
Backport of commit 6b3f804 from trunk.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
modules/luci-base/luasrc/model/ipkg.lua

index 110ea9580537758d31583863f7f8beb891750aa1..207d0543be686d9c39e5e5ee2de2e70710a0587f 100644 (file)
@@ -139,11 +139,13 @@ function _list(action, pat, cb)
                                desc = ""
                        end
 
-                       if #version > 26 then
-                               version = version:sub(1,21) .. ".." .. version:sub(-3,-1)
-                       end
+                       if name and version then
+                               if #version > 26 then
+                                       version = version:sub(1,21) .. ".." .. version:sub(-3,-1)
+                               end
 
-                       cb(name, version, sz, desc)
+                               cb(name, version, sz, desc)
+                       end
 
                        name    = nil
                        version = nil