X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/a849d4765ded55173cc10ba3e55a483d281b9174..c809e29b61d281d9584bb93f51ced02a6199802d:/src/smartxml/smartxml.js diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 7eab11b..203bdb2 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -598,9 +598,15 @@ $.extend(Document.prototype, Backbone.Events, { _defineDocumentProperties: function($document) { var doc = this; Object.defineProperty(doc, 'root', {get: function() { + if(!$document) { + return null; + } return doc.createDocumentNode($document[0]); }, configurable: true}); Object.defineProperty(doc, 'dom', {get: function() { + if(!$document) { + return null; + } return $document[0]; }, configurable: true}); }