From 679998283570ce9fbbe310a9f37169c20e871ef4 Mon Sep 17 00:00:00 2001 From: John Resig Date: Mon, 19 Jan 2009 23:04:03 +0000 Subject: [PATCH] Made sure that a child element exists before the check is done, fixes jQuery bug #3870. --- src/selector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/selector.js b/src/selector.js index 3371119..59ca2f6 100644 --- a/src/selector.js +++ b/src/selector.js @@ -700,7 +700,7 @@ try { // Check to see if an attribute returns normalized href attributes div.innerHTML = ""; - if ( div.firstChild.getAttribute("href") !== "#" ) { + if ( div.firstChild && div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function(elem){ return elem.getAttribute("href", 2); }; -- 1.7.10.4