luci-app-opkg: gracefully handle empty config files

Fixes: #3668
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 562425605a)
This commit is contained in:
Jo-Philipp Wich 2020-02-23 21:16:23 +01:00
parent 02c68f2838
commit 98ca75e918

View file

@ -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])));
});