1
0
Gildas 7 жил өмнө
parent
commit
4b559a89a2

+ 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;