UI: Added check for DOM element existence before calling draw function
This commit is contained in:
parent
327607e86d
commit
314dbed121
@ -73,7 +73,7 @@ export class LedLightComponent implements OnInit, AfterViewInit, OnChanges {
|
|||||||
for (const propName of Object.keys(changes)) {
|
for (const propName of Object.keys(changes)) {
|
||||||
const change = changes[propName];
|
const change = changes[propName];
|
||||||
if (!change.firstChange && change.currentValue !== change.previousValue) {
|
if (!change.firstChange && change.currentValue !== change.previousValue) {
|
||||||
if (propName === 'enabled') {
|
if (propName === 'enabled' && this.circleElement) {
|
||||||
this.draw();
|
this.draw();
|
||||||
} else if (propName === 'size') {
|
} else if (propName === 'size') {
|
||||||
this.update();
|
this.update();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user