Made sure that a child element exists before the check is done, fixes jQuery bug #3870.
This commit is contained in:
parent
735d44f6df
commit
6799982835
|
@ -700,7 +700,7 @@ try {
|
||||||
|
|
||||||
// Check to see if an attribute returns normalized href attributes
|
// Check to see if an attribute returns normalized href attributes
|
||||||
div.innerHTML = "<a href='#'></a>";
|
div.innerHTML = "<a href='#'></a>";
|
||||||
if ( div.firstChild.getAttribute("href") !== "#" ) {
|
if ( div.firstChild && div.firstChild.getAttribute("href") !== "#" ) {
|
||||||
Expr.attrHandle.href = function(elem){
|
Expr.attrHandle.href = function(elem){
|
||||||
return elem.getAttribute("href", 2);
|
return elem.getAttribute("href", 2);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue