Explorar el Código

verify responsiveImageData exists before reading it

Gildas hace 7 años
padre
commit
faf018e408
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      lib/single-file/single-file-core.js

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

@@ -516,7 +516,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			this.doc.querySelectorAll("picture, img[srcset]").forEach(element => {
 				const tagName = element.tagName.toLowerCase();
 				const dataAttributeName = DOM.responsiveImagesAttributeName(this.options.sessionId);
-				const responsiveImageData = this.options.responsiveImageData[Number(element.getAttribute(dataAttributeName))];
+				const responsiveImageData = this.options.responsiveImageData && this.options.responsiveImageData[Number(element.getAttribute(dataAttributeName))];
 				element.removeAttribute(dataAttributeName);
 				if (responsiveImageData) {
 					if (tagName == "img") {