Make sure that the body element exists before doing the body selector optimization. Fixes #6529.
This commit is contained in:
parent
5c055040d3
commit
e0a9615f82
|
@ -91,7 +91,7 @@ jQuery.fn = jQuery.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// The body element only exists once, optimize finding it
|
// The body element only exists once, optimize finding it
|
||||||
if ( selector === "body" && !context ) {
|
if ( selector === "body" && !context && document.body ) {
|
||||||
this.context = document;
|
this.context = document;
|
||||||
this[0] = document.body;
|
this[0] = document.body;
|
||||||
this.selector = "body";
|
this.selector = "body";
|
||||||
|
|
Loading…
Reference in a new issue