Commit 5c2d7097 authored by Jordan Boesch's avatar Jordan Boesch

bug 6158; fixing replaceWith from throwing errors on empty elements

parent 2d0bc7ce
...@@ -261,6 +261,9 @@ jQuery.fn.extend({ ...@@ -261,6 +261,9 @@ jQuery.fn.extend({
} }
}); });
} else { } else {
if ( !this.length ) {
return this;
}
return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ); return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment