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-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=a613a70fdb87163efa25a2d853cb9ed736d8cc39;hp=98204c7f6022958f277a7ea3bb8eacdc369753a4;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 7b97646..9e36082 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 ); } },