smartxml: handling undefined value sent to DocumentNode.sameNode
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 24 Oct 2013 09:33:38 +0000 (11:33 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 24 Oct 2013 09:33:38 +0000 (11:33 +0200)
src/smartxml/smartxml.js

index 6e00a7d..7c68e06 100644 (file)
@@ -29,7 +29,7 @@ $.extend(DocumentNode.prototype, {
     detach: function() { this._$.detach(); },
 
     sameNode: function(otherNode) {
     detach: function() { this._$.detach(); },
 
     sameNode: function(otherNode) {
-        return this.nativeNode === otherNode.nativeNode;
+        return otherNode && this.nativeNode === otherNode.nativeNode;
     },
 
     parent: function() {
     },
 
     parent: function() {