diff --git a/src/snapshot.ts b/src/snapshot.ts index fbffe2db..656de6ea 100644 --- a/src/snapshot.ts +++ b/src/snapshot.ts @@ -134,7 +134,7 @@ function getAbsoluteSrcsetString(doc: Document, attributeValue: string) { } export function absoluteToDoc(doc: Document, attributeValue: string): string { - if (attributeValue.trim() === '') { + if (!attributeValue || attributeValue.trim() === '') { return attributeValue; } const a: HTMLAnchorElement = doc.createElement('a');