Commit 314dbed1216852fdd9bf7acdeb8d3bb19d2363d6
1 parent
327607e8
UI: Added check for DOM element existence before calling draw function
Showing
1 changed file
with
1 additions
and
1 deletions
@@ -73,7 +73,7 @@ export class LedLightComponent implements OnInit, AfterViewInit, OnChanges { | @@ -73,7 +73,7 @@ export class LedLightComponent implements OnInit, AfterViewInit, OnChanges { | ||
73 | for (const propName of Object.keys(changes)) { | 73 | for (const propName of Object.keys(changes)) { |
74 | const change = changes[propName]; | 74 | const change = changes[propName]; |
75 | if (!change.firstChange && change.currentValue !== change.previousValue) { | 75 | if (!change.firstChange && change.currentValue !== change.previousValue) { |
76 | - if (propName === 'enabled') { | 76 | + if (propName === 'enabled' && this.circleElement) { |
77 | this.draw(); | 77 | this.draw(); |
78 | } else if (propName === 'size') { | 78 | } else if (propName === 'size') { |
79 | this.update(); | 79 | this.update(); |