luci-app-samba4: prevent calling split() on array or null values
authorJo-Philipp Wich <jo@mein.io>
Mon, 31 May 2021 09:25:54 +0000 (11:25 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 31 May 2021 09:27:48 +0000 (11:27 +0200)
commit81f41819a58b3559dc0bbaa47d4bf599b2305c5c
tree009a4b000fb088e8ca4eefb74f80260e6f83912a
parent09329fe7bb6571032570b21541c1991a3443cc07
luci-app-samba4: prevent calling split() on array or null values

Since `uci.get()` may return null or array values, we cannot blindly call
split() on the result. Use the safe `L.toArray()` helper which is intended
to deal with such situations.

Also clean up whitespace while we're at.

Fixes: #5080
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c4cdfcbe5121d5959dac1e18ed11b8611a86fb9e)
applications/luci-app-samba4/htdocs/luci-static/resources/view/samba4.js