diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2012-02-22 00:21:18 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-02-23 22:40:07 -0500 |
commit | a619cb3063c104aa5ec808e13d2c84af565eacc6 (patch) | |
tree | 37731dfd6626427e55b3e8e15a1f09130fdd8f32 /src | |
parent | 7226cf2800315e90b671db63f2b5f51150ad7e8e (diff) | |
download | jquery-a619cb3063c104aa5ec808e13d2c84af565eacc6.tar.gz jquery-a619cb3063c104aa5ec808e13d2c84af565eacc6.zip |
Fix #11370: .siblings() shouldn't throw exception on a detached element
Diffstat (limited to 'src')
-rw-r--r-- | src/traversing.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/traversing.js b/src/traversing.js index c342e15c1..08c95ec4a 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -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 ); |