check parentNode when calling insertBefore
When add new nodes, we may use insertBefore API to insert node before its next sibling. But the sibling may not in the DOM tree at that moment if it was in the missing node map.
This commit is contained in:
@@ -271,9 +271,13 @@ export class Replayer {
|
||||
return;
|
||||
}
|
||||
|
||||
if (previous && previous.nextSibling) {
|
||||
if (
|
||||
previous &&
|
||||
previous.nextSibling &&
|
||||
previous.nextSibling.parentNode
|
||||
) {
|
||||
parent.insertBefore(target, previous.nextSibling);
|
||||
} else if (next) {
|
||||
} else if (next && next.parentNode) {
|
||||
parent.insertBefore(target, next);
|
||||
} else {
|
||||
parent.appendChild(target);
|
||||
|
||||
Reference in New Issue
Block a user