Skip to content

Commit

Permalink
Skip rendering sections without URLs
Browse files Browse the repository at this point in the history
Sometimes the cover section has no URL -- try not to fail when that's the case.
  • Loading branch information
AbeJellinek committed Jan 3, 2024
1 parent 7008922 commit a166653
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dom/epub/section-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ class SectionView {
if (this.body) {
throw new Error('Already rendered');
}
if (!this.section.url) {
console.error('Section has no URL', this.section);
this.body = this._document.createElement('div');
return;
}
let xhtml = await this.section.render(requestFn);
this.body = await sanitizeAndRender(xhtml,
{ container: this.container, styleScoper: this._styleScoper });
Expand Down

0 comments on commit a166653

Please sign in to comment.