diff --git a/ui-ngx/src/app/shared/components/device/gateway-configuration.component.ts b/ui-ngx/src/app/shared/components/device/gateway-configuration.component.ts index dd802d20b1..76a21a63ae 100644 --- a/ui-ngx/src/app/shared/components/device/gateway-configuration.component.ts +++ b/ui-ngx/src/app/shared/components/device/gateway-configuration.component.ts @@ -31,6 +31,7 @@ import { DeviceService } from '@core/http/device.service'; import { of } from 'rxjs'; import { mergeMap } from 'rxjs/operators'; import { DeviceCredentialsType } from '@shared/models/device.models'; +import { NULL_UUID } from '@shared/models/id/has-uuid'; export enum StorageTypes { MEMORY = 'memory', @@ -317,6 +318,7 @@ export class GatewayConfigurationComponent implements OnInit { } fetchConfigAttribute(entityId: EntityId) { + if (entityId.id === NULL_UUID) return; this.attributeService.getEntityAttributes(entityId, AttributeScope.CLIENT_SCOPE, ['general_configuration', 'grpc_configuration', 'logs_configuration', 'storage_configuration', 'RemoteLoggingLevel']).pipe( mergeMap(attributes => attributes.length ? of(attributes) : this.attributeService.getEntityAttributes( diff --git a/ui-ngx/src/app/shared/components/device/gateway-connectors.component.ts b/ui-ngx/src/app/shared/components/device/gateway-connectors.component.ts index 086cf55f6d..d51633488a 100644 --- a/ui-ngx/src/app/shared/components/device/gateway-connectors.component.ts +++ b/ui-ngx/src/app/shared/components/device/gateway-connectors.component.ts @@ -39,6 +39,7 @@ import { ActionNotificationShow } from '@core/notification/notification.actions' import { DialogService } from '@app/core/services/dialog.service'; import { WidgetContext } from '@home/models/widget-component.models'; import { deepClone } from '@core/utils'; +import { NULL_UUID } from '@shared/models/id/has-uuid'; export interface gatewayConnector { @@ -161,6 +162,7 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie this.viewsInited = true; if (this.device) { + if (this.device.id === NULL_UUID) return; forkJoin(this.attributeService.getEntityAttributes(this.device, AttributeScope.SHARED_SCOPE, ['active_connectors']), this.attributeService.getEntityAttributes(this.device, AttributeScope.SERVER_SCOPE, ['inactive_connectors'])).subscribe(attributes => { if (attributes.length) { diff --git a/ui-ngx/src/app/shared/components/device/gateway-statistics.component.ts b/ui-ngx/src/app/shared/components/device/gateway-statistics.component.ts index 91ddd1ab9e..089e83af04 100644 --- a/ui-ngx/src/app/shared/components/device/gateway-statistics.component.ts +++ b/ui-ngx/src/app/shared/components/device/gateway-statistics.component.ts @@ -39,6 +39,7 @@ import { PageLink } from '@shared/models/page/page-link'; import { Direction, SortOrder } from '@shared/models/page/sort-order'; import { MatTableDataSource } from '@angular/material/table'; import { MatSort } from '@angular/material/sort'; +import { NULL_UUID } from '@shared/models/id/has-uuid'; @Component({ @@ -124,8 +125,8 @@ export class GatewayStatisticsComponent extends PageComponent implements AfterVi }) this.init(); if (this.ctx.defaultSubscription.datasources.length) { - const gateway = this.ctx.defaultSubscription.datasources[0].entity; + if (gateway.id.id === NULL_UUID) return; if (!this.general) { this.attributeService.getEntityAttributes(gateway.id, AttributeScope.SHARED_SCOPE, ["general_configuration"]).subscribe((resp: AttributeData[]) => { if (resp && resp.length) {