Fix #11370: .siblings() shouldn't throw exception on a detached element

This commit is contained in:
Richard Gibson
2012-02-22 00:21:18 -05:00
committed by Dave Methvin
parent 7226cf2800
commit a619cb3063
2 changed files with 3 additions and 2 deletions

View File

@@ -204,7 +204,7 @@ jQuery.each({
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return jQuery.sibling( elem.parentNode.firstChild, elem );
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );