Skip to content

Commit 4b3e79f

Browse files
committed
fix(chartjs.component): TypeError: Cannot read properties of null (reading 'ownerDocument')
1 parent 648a1ed commit 4b3e79f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

projects/coreui-angular-chartjs/src/lib/chartjs.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ export class ChartjsComponent implements OnDestroy {
272272
setTimeout(() => {
273273
this.ngZone.runOutsideAngular(() => {
274274
try {
275-
this.chart?.update();
275+
if (this.chart?.canvas) {
276+
this.chart?.update();
277+
}
276278
} catch (error) {
277279
console.warn('Error on chart.update():', error);
278280
}

0 commit comments

Comments
 (0)