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)
This commit is contained in:
parent
09329fe7bb
commit
81f41819a5
@ -35,7 +35,7 @@ return view.extend({
|
|||||||
_('Listen only on the given interface or, if unspecified, on lan'));
|
_('Listen only on the given interface or, if unspecified, on lan'));
|
||||||
o.multiple = true;
|
o.multiple = true;
|
||||||
o.cfgvalue = function(section_id) {
|
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) {
|
o.write = function(section_id, formvalue) {
|
||||||
var cfgvalue = this.cfgvalue(section_id),
|
var cfgvalue = this.cfgvalue(section_id),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user