Make sure that the node exists before attempting to clone.
authorjeresig <jeresig@gmail.com>
Thu, 17 Dec 2009 18:15:12 +0000 (13:15 -0500)
committerjeresig <jeresig@gmail.com>
Thu, 17 Dec 2009 18:15:12 +0000 (13:15 -0500)
src/manipulation.js

index 17cfa84..d5523dd 100644 (file)
@@ -279,7 +279,7 @@ function cloneCopyEvent(orig, ret) {
        var i = 0;
 
        ret.each(function(){
-               if ( this.nodeName !== orig[i].nodeName ) {
+               if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
                        return;
                }