mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-22 14:00:03 +00:00
Robustify widget.removeLocalDomNodes
Otherwise we get crashes if the DOM nodes generated by a widget have been subsequently modified by something like MathJax – see https://talk.tiddlywiki.org/t/tw-5-3-0-js-exception/7488/2
This commit is contained in:
parent
0c64b58cfb
commit
29b5b064d6
@ -750,7 +750,9 @@ Widget.prototype.removeLocalDomNodes = function() {
|
||||
// If this widget has directly created DOM nodes, delete them and exit.
|
||||
if(this.domNodes.length > 0) {
|
||||
$tw.utils.each(this.domNodes,function(domNode) {
|
||||
domNode.parentNode.removeChild(domNode);
|
||||
if(domNode.parentNode) {
|
||||
domNode.parentNode.removeChild(domNode);
|
||||
}
|
||||
});
|
||||
this.domNodes = [];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user