diff --git a/src/op_mode/dhcp.py b/src/op_mode/dhcp.py index 20f54df25c..45de86cab7 100755 --- a/src/op_mode/dhcp.py +++ b/src/op_mode/dhcp.py @@ -113,7 +113,7 @@ def _get_raw_server_leases(family='inet', pool=None, sorted=None, state=[], orig data_lease['origin'] = 'local' # TODO: Determine remote in HA data_lease['hostname'] = lease.get('hostname', '-') # remove trailing dot to ensure consistency for `vyos-hostsd-client` - if data_lease['hostname'][-1] == '.': + if data_lease['hostname'] and data_lease['hostname'][-1] == '.': data_lease['hostname'] = data_lease['hostname'][:-1] if family == 'inet':