File tree 2 files changed +8
-3
lines changed 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1346,7 +1346,8 @@ export function serializeNodeWithId(
1346
1346
stylesheetLoadTimeout,
1347
1347
keepIframeSrcFn,
1348
1348
} ;
1349
- for ( const childN of Array . from ( n . childNodes ) ) {
1349
+ const childNodes = n . childNodes ? Array . from ( n . childNodes ) : [ ] ;
1350
+ for ( const childN of childNodes ) {
1350
1351
const serializedChildNode = serializeNodeWithId ( childN , bypassOptions ) ;
1351
1352
if ( serializedChildNode ) {
1352
1353
serializedNode . childNodes . push ( serializedChildNode ) ;
Original file line number Diff line number Diff line change @@ -829,7 +829,9 @@ export default class MutationBuffer {
829
829
false ,
830
830
)
831
831
) {
832
- n . childNodes . forEach ( ( childN ) => this . genAdds ( childN ) ) ;
832
+ if ( n . childNodes ) {
833
+ n . childNodes . forEach ( ( childN ) => this . genAdds ( childN ) ) ;
834
+ }
833
835
if ( hasShadowRoot ( n ) ) {
834
836
n . shadowRoot . childNodes . forEach ( ( childN ) => {
835
837
this . processedNodeManager . add ( childN , this ) ;
@@ -848,7 +850,9 @@ export default class MutationBuffer {
848
850
*/
849
851
function deepDelete ( addsSet : Set < Node > , n : Node ) {
850
852
addsSet . delete ( n ) ;
851
- n . childNodes . forEach ( ( childN ) => deepDelete ( addsSet , childN ) ) ;
853
+ if ( n . childNodes ) {
854
+ n . childNodes . forEach ( ( childN ) => deepDelete ( addsSet , childN ) ) ;
855
+ }
852
856
}
853
857
854
858
function isParentRemoved (
You can’t perform that action at this time.
0 commit comments