From a619cb3063c104aa5ec808e13d2c84af565eacc6 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 22 Feb 2012 00:21:18 -0500 Subject: Fix #11370: .siblings() shouldn't throw exception on a detached element --- src/traversing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 ); -- cgit v1.2.3