Skip to content
Permalink
Browse files

Made sure that a child element exists before the check is done, fixes…

… jQuery bug #3870.
  • Loading branch information
jeresig committed Jan 19, 2009
1 parent 735d44f commit 679998283570ce9fbbe310a9f37169c20e871ef4
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/selector.js
@@ -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);
};

0 comments on commit 6799982

Please sign in to comment.
You can’t perform that action at this time.