Brought the logic for handling isXMLDoc over from Sizzle.
[jquery.git] / src / selector.js
index 3371119..59ca2f6 100644 (file)
@@ -700,7 +700,7 @@ try {
 
        // Check to see if an attribute returns normalized href attributes
        div.innerHTML = "<a href='#'></a>";
-       if ( div.firstChild.getAttribute("href") !== "#" ) {
+       if ( div.firstChild && div.firstChild.getAttribute("href") !== "#" ) {
                Expr.attrHandle.href = function(elem){
                        return elem.getAttribute("href", 2);
                };