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:15:48 +0000 (17:15 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js

index be1bd944e68581e5ac07af57a867f87ce7697b7d..fe5600e880f0ae3ba2656d9d74d57148f08020ff 100644 (file)
@@ -181,7 +181,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 ];