From e0a9615f82fcdad73de6db42a995eb2a5550e361 Mon Sep 17 00:00:00 2001
From: jeresig <jeresig@gmail.com>
Date: Fri, 24 Sep 2010 15:53:38 -0400
Subject: [PATCH] Make sure that the body element exists before doing the body
 selector optimization. Fixes #6529.

---
 src/core.js |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core.js b/src/core.js
index 6c6d006..cc92138 100644
--- a/src/core.js
+++ b/src/core.js
@@ -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";
-- 
1.7.10.4