luci-mod-network: dhcp.js: allow lease hostname to be empty
authorJo-Philipp Wich <jo@mein.io>
Sat, 11 Apr 2020 16:34:54 +0000 (18:34 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 11 Apr 2020 16:34:54 +0000 (18:34 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js

index 6551b72731b5d8b0f304bdbb7c132b41dac9019f..fa991db41d6f85cf9fb225748381beb31c44b5e1 100644 (file)
@@ -66,6 +66,9 @@ CBILease6Status = form.DummyValue.extend({
 });
 
 function validateHostname(sid, s) {
+       if (s == null || s == '')
+               return true;
+
        if (s.length > 256)
                return _('Expecting: %s').format(_('valid hostname'));