aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-10-11 07:45:15 -0400
committerJohn Resig <jeresig@gmail.com>2010-10-11 07:45:15 -0400
commit385ca2aa899d2ed953d9e18c95387e72e330b42c (patch)
tree56fec240be4e1111532fdf9350103ccbc0954abf /src
parent2c04035cd1d7cb1e73c6e9b2d63fc77e5165b8fc (diff)
downloadjquery-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.js2
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;
}
}