We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce902e1 commit f19a701Copy full SHA for f19a701
src/platform/platform.dom.js
@@ -386,7 +386,12 @@ export default class DomPlatform extends BasePlatform {
386
}
387
388
const proxy = proxies[type] = throttled((event) => {
389
- listener(fromNativeEvent(event, chart));
+ // This case can occur if the chart is destroyed while waiting
390
+ // for the throttled function to occur. We prevent crashes by checking
391
+ // for a destroyed chart
392
+ if (chart.ctx !== null) {
393
+ listener(fromNativeEvent(event, chart));
394
+ }
395
}, chart);
396
397
addListener(canvas, type, proxy);
0 commit comments