single-file-core 1.0.71 → 1.0.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.0.71",
3
+ "version": "1.0.72",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",
@@ -626,7 +626,7 @@ class Processor {
626
626
  }
627
627
  });
628
628
  }
629
- if (this.options.adoptedStyleSheets.length) {
629
+ if (this.options.adoptedStyleSheets && this.options.adoptedStyleSheets.length) {
630
630
  const styleElement = this.doc.createElement("style");
631
631
  styleElement.textContent = this.options.adoptedStyleSheets.join("\n");
632
632
  this.doc.body.appendChild(styleElement);
@@ -1194,7 +1194,7 @@ class Processor {
1194
1194
  if (shadowRootData) {
1195
1195
  const templateElement = doc.createElement("template");
1196
1196
  templateElement.setAttribute(SHADOWROOT_ATTRIBUTE_NAME, shadowRootData.mode);
1197
- if (shadowRootData.adoptedStyleSheets) {
1197
+ if (shadowRootData.adoptedStyleSheets && shadowRootData.adoptedStyleSheets.length) {
1198
1198
  shadowRootData.adoptedStyleSheets.forEach(stylesheetContent => {
1199
1199
  const styleElement = doc.createElement("style");
1200
1200
  styleElement.textContent = stylesheetContent;