Skip to content

Commit

Permalink
jquery core: Closes #3737. Fixed a possible null dereference.
Browse files Browse the repository at this point in the history
  • Loading branch information
flesler committed Dec 25, 2008
1 parent eff400e commit 8cd50a3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core.js
Expand Up @@ -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 );
}
}

Expand Down

0 comments on commit 8cd50a3

Please sign in to comment.