From 98ca75e918baf7b5aff68c634ba02149c05bfec7 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 23 Feb 2020 21:16:23 +0100 Subject: [PATCH] luci-app-opkg: gracefully handle empty config files Fixes: #3668 Signed-off-by: Jo-Philipp Wich (cherry picked from commit 562425605af51443986cb2596199564e4102ffff) --- .../luci-app-opkg/htdocs/luci-static/resources/view/opkg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js index 5442e794b..c7cb55fc4 100644 --- a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js +++ b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js @@ -662,7 +662,7 @@ function handleConfig(ev) body.push(E('h5', {}, '%h'.format(file))); body.push(E('textarea', { 'name': file, - 'rows': Math.max(Math.min(conf[file].match(/\n/g).length, 10), 3) + 'rows': Math.max(Math.min(L.toArray(conf[file].match(/\n/g)).length, 10), 3) }, '%h'.format(conf[file]))); }); -- 2.25.1