From 0ab8a36832616d65b85f4b085d2dcebee5090284 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 13 Nov 2020 11:05:00 +0100 Subject: [PATCH] bugfix with none in the mac serial --- ereuse_devicehub/resources/device/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 4efd0189..2983e2ec 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -462,14 +462,15 @@ class Computer(Device): self.set_hid() if not self.hid: return - components = self.components if components_snap == None else components_snap - macs_network= [c.serial_number for c in components if c.type == 'NetworkAdapter'] + components = self.components if components_snap is None else components_snap + macs_network = [c.serial_number for c in components + if c.type == 'NetworkAdapter' and c.serial_number is not None] macs_network.sort() mac = macs_network[0] if macs_network else '' if not mac or mac in self.hid: return mac = f"-{mac}" - self.hid += mac + self.hid += mac def __format__(self, format_spec): if not format_spec: