diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-10-20 21:04:38 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-10-20 21:04:46 +0200 |
commit | 6b3f804956e50b3e3afc96bd866b089d4523c6e2 (patch) | |
tree | 3b204341566240419f3b0a7ca0d6bcf401849116 /modules/luci-base/luasrc/model/ipkg.lua | |
parent | b5826f1ffb19288b8bfdc63f4b77700cfabe1181 (diff) |
luci-base: filter invalid opkg status lines
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules/luci-base/luasrc/model/ipkg.lua')
-rw-r--r-- | modules/luci-base/luasrc/model/ipkg.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/luci-base/luasrc/model/ipkg.lua b/modules/luci-base/luasrc/model/ipkg.lua index 2ed92ca70..e653b0346 100644 --- a/modules/luci-base/luasrc/model/ipkg.lua +++ b/modules/luci-base/luasrc/model/ipkg.lua @@ -139,11 +139,13 @@ local 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 @@ -238,4 +240,3 @@ function compare_versions(ver1, comp, ver2) -- all equal and not compare greater or lower then true return not (comp == "<" or comp == ">") end - |