Commit e0a9615f authored by jeresig's avatar jeresig

Make sure that the body element exists before doing the body selector optimization. Fixes #6529.

parent 5c055040
......@@ -91,7 +91,7 @@ jQuery.fn = jQuery.prototype = {
}
// The body element only exists once, optimize finding it
if ( selector === "body" && !context ) {
if ( selector === "body" && !context && document.body ) {
this.context = document;
this[0] = document.body;
this.selector = "body";
......
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