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 ) {
|
||||
for ( var i = 0; ret[i]; i++ ) {
|
||||
if ( jQuery.nodeName( ret[i], "script" ) ) {
|
||||
ret[i].parentNode.removeChild( ret[i] );
|
||||
elem = ret[i];
|
||||
if ( jQuery.nodeName( elem, "script" ) ) {
|
||||
if( elem.parentNode )
|
||||
elem.parentNode.removeChild( elem );
|
||||
} else {
|
||||
if ( ret[i].nodeType === 1 )
|
||||
ret = jQuery.merge( ret, ret[i].getElementsByTagName("script"));
|
||||
fragment.appendChild( ret[i] );
|
||||
if ( elem.nodeType === 1 )
|
||||
ret = jQuery.merge( ret, elem.getElementsByTagName("script"));
|
||||
fragment.appendChild( elem );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue