jquery core: Closes #3737. Fixed a possible null dereference.
This commit is contained in:
parent
eff400e44f
commit
8cd50a398d
1 changed files with 7 additions and 5 deletions
12
src/core.js
12
src/core.js
|
@ -1016,12 +1016,14 @@ jQuery.extend({
|
||||||
|
|
||||||
if ( fragment ) {
|
if ( fragment ) {
|
||||||
for ( var i = 0; ret[i]; i++ ) {
|
for ( var i = 0; ret[i]; i++ ) {
|
||||||
if ( jQuery.nodeName( ret[i], "script" ) ) {
|
elem = ret[i];
|
||||||
ret[i].parentNode.removeChild( ret[i] );
|
if ( jQuery.nodeName( elem, "script" ) ) {
|
||||||
|
if( elem.parentNode )
|
||||||
|
elem.parentNode.removeChild( elem );
|
||||||
} else {
|
} else {
|
||||||
if ( ret[i].nodeType === 1 )
|
if ( elem.nodeType === 1 )
|
||||||
ret = jQuery.merge( ret, ret[i].getElementsByTagName("script"));
|
ret = jQuery.merge( ret, elem.getElementsByTagName("script"));
|
||||||
fragment.appendChild( ret[i] );
|
fragment.appendChild( elem );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue