From: David Serduke Date: Mon, 5 Nov 2007 18:49:00 +0000 (+0000) Subject: Added a check to make sure a parent node exists in call remove() to avoid errors... X-Git-Tag: 1.2.2b~82 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a613a70fdb87163efa25a2d853cb9ed736d8cc39;p=jquery.git Added a check to make sure a parent node exists in call remove() to avoid errors as seen in bug #1742. --- diff --git a/src/core.js b/src/core.js index 7b97646ae..9e36082cf 100644 --- a/src/core.js +++ b/src/core.js @@ -1268,7 +1268,8 @@ jQuery.each({ jQuery.event.remove(this); jQuery.removeData(this); }); - this.parentNode.removeChild( this ); + if (this.parentNode) + this.parentNode.removeChild( this ); } },