fix: Use of view after destroyed, closes #5982

This commit is contained in:
Tom Moor
2023-10-10 19:00:12 -04:00
parent fec1a72780
commit 8354a5bc37
2 changed files with 4 additions and 2 deletions

View File

@@ -220,7 +220,9 @@ export default function Prism({
// it render un-highlighted and then trigger a defered render of Prism
// by updating the plugins metadata
setTimeout(() => {
view.dispatch(view.state.tr.setMeta("prism", { loaded: true }));
if (!view.isDestroyed) {
view.dispatch(view.state.tr.setMeta("prism", { loaded: true }));
}
}, 10);
}
return {};