From c8b12e7fa925148a765f589df1af41797727db46 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sat, 24 Oct 2015 09:40:55 +0300 Subject: [PATCH] Backport luci-base: filter invalid opkg status lines Backport of commit 6b3f804 from trunk. Signed-off-by: Hannu Nyman --- modules/luci-base/luasrc/model/ipkg.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/luci-base/luasrc/model/ipkg.lua b/modules/luci-base/luasrc/model/ipkg.lua index 110ea9580..207d0543b 100644 --- a/modules/luci-base/luasrc/model/ipkg.lua +++ b/modules/luci-base/luasrc/model/ipkg.lua @@ -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 -- 2.25.1