From 5c3b9e0c24dbb31245e9266dcd20fface92747eb Mon Sep 17 00:00:00 2001 From: rwldrn Date: Wed, 15 Jun 2011 11:14:52 -0400 Subject: jQuery.clone() check that destination child nodes are not null. Fixes #9587 --- src/manipulation.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/manipulation.js b/src/manipulation.js index 439b9596b..2f41feb9a 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -564,7 +564,10 @@ jQuery.extend({ // with an element if you are cloning the body and one of the // elements on the page has a name or id of "length" for ( i = 0; srcElements[i]; ++i ) { - cloneFixAttributes( srcElements[i], destElements[i] ); + // Ensure that the destination node is not null; Fixes #9587 + if ( destElements[i] ) { + cloneFixAttributes( srcElements[i], destElements[i] ); + } } } @@ -762,4 +765,4 @@ function evalScript( i, elem ) { } } -})( jQuery ); \ No newline at end of file +})( jQuery ); -- cgit v1.2.3