From: Aleksander Ɓukasz Date: Thu, 24 Oct 2013 09:33:38 +0000 (+0200) Subject: smartxml: handling undefined value sent to DocumentNode.sameNode X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/02aa7e89997fd35f7c57dd300507b5dd9ad64992?ds=sidebyside;hp=9a93c89991001d4ed088bee3b20cea374aa91d37 smartxml: handling undefined value sent to DocumentNode.sameNode --- diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 6e00a7d..7c68e06 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -29,7 +29,7 @@ $.extend(DocumentNode.prototype, { detach: function() { this._$.detach(); }, sameNode: function(otherNode) { - return this.nativeNode === otherNode.nativeNode; + return otherNode && this.nativeNode === otherNode.nativeNode; }, parent: function() {