bugfix with none in the mac serial

This commit is contained in:
Cayo Puigdefabregas 2020-11-13 11:05:00 +01:00
parent b56c3d3e0a
commit 0ab8a36832

View file

@ -462,8 +462,9 @@ class Computer(Device):
self.set_hid() self.set_hid()
if not self.hid: if not self.hid:
return return
components = self.components if components_snap == None else components_snap components = self.components if components_snap is None else components_snap
macs_network= [c.serial_number for c in components if c.type == 'NetworkAdapter'] macs_network = [c.serial_number for c in components
if c.type == 'NetworkAdapter' and c.serial_number is not None]
macs_network.sort() macs_network.sort()
mac = macs_network[0] if macs_network else '' mac = macs_network[0] if macs_network else ''
if not mac or mac in self.hid: if not mac or mac in self.hid: