Merge branch 'bug_6158' of https://github.com/jboesch/jquery into jboesch-bug_6158

This commit is contained in:
John Resig 2011-03-15 17:06:24 -04:00
commit 0cf336d2c9
2 changed files with 8 additions and 3 deletions

View file

@ -261,7 +261,9 @@ jQuery.fn.extend({
}
});
} else {
return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
return this.length ?
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
this;
}
},