jquery core: Closes #3737. Fixed a possible null dereference.

This commit is contained in:
Ariel Flesler 2008-12-25 21:20:41 +00:00
parent eff400e44f
commit 8cd50a398d

View file

@ -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 );
}
}