From: Jo-Philipp Wich Date: Sun, 23 Feb 2020 20:16:23 +0000 (+0100) Subject: luci-app-opkg: gracefully handle empty config files X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=98ca75e918baf7b5aff68c634ba02149c05bfec7;p=oweals%2Fluci.git luci-app-opkg: gracefully handle empty config files Fixes: #3668 Signed-off-by: Jo-Philipp Wich (cherry picked from commit 562425605af51443986cb2596199564e4102ffff) --- 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]))); });