diff options
author | John Resig <jeresig@gmail.com> | 2010-10-11 07:45:15 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-10-11 07:45:15 -0400 |
commit | 385ca2aa899d2ed953d9e18c95387e72e330b42c (patch) | |
tree | 56fec240be4e1111532fdf9350103ccbc0954abf /src | |
parent | 2c04035cd1d7cb1e73c6e9b2d63fc77e5165b8fc (diff) | |
download | jquery-385ca2aa899d2ed953d9e18c95387e72e330b42c.tar.gz jquery-385ca2aa899d2ed953d9e18c95387e72e330b42c.zip |
Make sure closest works on disconnected DOM nodes. Fixes #7142.
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 de250e6c6..5a479f2ef 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -108,7 +108,7 @@ jQuery.fn.extend({ } else { cur = cur.parentNode; - if ( !cur.ownerDocument || cur === context ) { + if ( !cur || !cur.ownerDocument || cur === context ) { break; } } |