Ver Fonte

make sure this.options.doc is defined before accessing properties

Gildas há 7 anos atrás
pai
commit
35b86c0afd
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      lib/single-file/single-file-core.js

+ 1 - 1
lib/single-file/single-file-core.js

@@ -143,7 +143,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		constructor(options, root) {
 			this.root = root;
 			this.options = options;
-			this.options.url = this.options.url || this.options.doc.location.href;
+			this.options.url = this.options.url || (this.options.doc && this.options.doc.location.href);
 			this.options.baseURI = this.options.doc && this.options.doc.baseURI;
 			this.batchRequest = new BatchRequest();
 			this.processor = new Processor(options, this.batchRequest);