diff --git a/client/src/app/_services/project.service.ts b/client/src/app/_services/project.service.ts index 525671f96..2f1ae5fd9 100644 --- a/client/src/app/_services/project.service.ts +++ b/client/src/app/_services/project.service.ts @@ -962,19 +962,21 @@ export class ProjectService { checkSystemTags() { let devices = Object.values(this.projectData.devices).filter((device: Device) => device.id !== FuxaServer.id); let fuxaServer = this.projectData.devices[FuxaServer.id]; - devices.forEach((device: Device) => { - if (!Object.values(fuxaServer.tags).find((tag: Tag) => tag.sysType === TagSystemType.deviceConnectionStatus && tag.memaddress === device.id)) { - let tag = new Tag(Utils.getGUID(TAG_PREFIX)); - tag.name = device.name + ' Connection Status'; - tag.label = device.name + ' Connection Status'; - tag.type = ServerTagType.number; - tag.memaddress = device.id; - tag.sysType = TagSystemType.deviceConnectionStatus; - tag.init = tag.value = ''; - fuxaServer.tags[tag.id] = tag; - } - }); - this.setDeviceTags(fuxaServer); + if (fuxaServer) { + devices.forEach((device: Device) => { + if (!Object.values(fuxaServer.tags).find((tag: Tag) => tag.sysType === TagSystemType.deviceConnectionStatus && tag.memaddress === device.id)) { + let tag = new Tag(Utils.getGUID(TAG_PREFIX)); + tag.name = device.name + ' Connection Status'; + tag.label = device.name + ' Connection Status'; + tag.type = ServerTagType.number; + tag.memaddress = device.id; + tag.sysType = TagSystemType.deviceConnectionStatus; + tag.init = tag.value = ''; + fuxaServer.tags[tag.id] = tag; + } + }); + this.setDeviceTags(fuxaServer); + } return this.getDevices(); } diff --git a/client/src/app/device/device-property/device-property.component.ts b/client/src/app/device/device-property/device-property.component.ts index 665ae9121..9011b2607 100644 --- a/client/src/app/device/device-property/device-property.component.ts +++ b/client/src/app/device/device-property/device-property.component.ts @@ -196,7 +196,8 @@ export class DevicePropertyComponent implements OnInit, OnDestroy { if (this.subscriptionDeviceWebApiRequest) { this.subscriptionDeviceWebApiRequest.unsubscribe(); } - } catch (e) { + } catch (err) { + console.error(err); } }