Gildas 7 лет назад
Родитель
Сommit
4b559a89a2
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      lib/single-file/doc-helper.js

+ 2 - 2
lib/single-file/doc-helper.js

@@ -162,8 +162,8 @@ this.docHelper = this.docHelper || (() => {
 				imageElement.setAttribute(imagesAttributeName(options.sessionId), imageElementIndex);
 				let imageData;
 				const computedStyle = getComputedStyle(imageElement);
-				const paddingIsSet = computedStyle.padding != "0px";
-				const marginIsSet = computedStyle.margin != "0px";
+				const paddingIsSet = computedStyle.padding && computedStyle.padding != "0px";
+				const marginIsSet = computedStyle.margin && computedStyle.margin != "0px";
 				if (imageElement.src && !paddingIsSet && !marginIsSet) {
 					let naturalWidth = imageElement.naturalWidth;
 					let naturalHeight = imageElement.naturalHeight;