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>
This commit is contained in:
parent
00d518d697
commit
c4cdfcbe51
1 changed files with 13 additions and 13 deletions
|
@ -35,7 +35,7 @@ return view.extend({
|
|||
_('Listen only on the given interface or, if unspecified, on lan'));
|
||||
o.multiple = true;
|
||||
o.cfgvalue = function(section_id) {
|
||||
return uci.get('samba4', section_id, 'interface').split(' ');
|
||||
return L.toArray(uci.get('samba4', section_id, 'interface'));
|
||||
};
|
||||
o.write = function(section_id, formvalue) {
|
||||
var cfgvalue = this.cfgvalue(section_id),
|
||||
|
|
Loading…
Reference in a new issue