luci-app-opkg: fix parsing empty package repository indexes
authorJo-Philipp Wich <jo@mein.io>
Sat, 20 Mar 2021 16:15:48 +0000 (17:15 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sat, 20 Mar 2021 16:16:20 +0000 (17:16 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3bcbcbf0889142ca19b893f41318963b69de90ab)

applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js

index 8e33d563794fd35ca452187cb03f7fefb307d1b8..2fc6555813b9375d53801c2ea01ba67d14f56e0d 100644 (file)
@@ -86,7 +86,7 @@ function parseList(s, dest)
                        key = RegExp.$1.toLowerCase();
                        val = RegExp.$2.trim();
                }
-               else {
+               else if (pkg) {
                        dest.pkgs[pkg.name] = pkg;
 
                        var provides = dest.providers[pkg.name] ? [] : [ pkg.name ];