From 314dbed1216852fdd9bf7acdeb8d3bb19d2363d6 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Tue, 17 Aug 2021 10:27:55 +0300 Subject: [PATCH] UI: Added check for DOM element existence before calling draw function --- ui-ngx/src/app/shared/components/led-light.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/app/shared/components/led-light.component.ts b/ui-ngx/src/app/shared/components/led-light.component.ts index 35dea1242d..3c1c736659 100644 --- a/ui-ngx/src/app/shared/components/led-light.component.ts +++ b/ui-ngx/src/app/shared/components/led-light.component.ts @@ -73,7 +73,7 @@ export class LedLightComponent implements OnInit, AfterViewInit, OnChanges { for (const propName of Object.keys(changes)) { const change = changes[propName]; if (!change.firstChange && change.currentValue !== change.previousValue) { - if (propName === 'enabled') { + if (propName === 'enabled' && this.circleElement) { this.draw(); } else if (propName === 'size') { this.update();