diff --git a/src/web/mjs/engine/Chapter.mjs b/src/web/mjs/engine/Chapter.mjs index 43164ea81c..064b6f2ef1 100644 --- a/src/web/mjs/engine/Chapter.mjs +++ b/src/web/mjs/engine/Chapter.mjs @@ -111,9 +111,9 @@ export default class Chapter extends EventTarget { this.manga.connector._getPageList( this.manga, this, ( error, pages ) => { this.pageCache = []; if( !error ) { - if(pages.length || pages.video || pages.mirrors && pages.mirrors.length) { + if(pages?.length || pages?.video || pages?.mirrors && pages?.mirrors.length) { // HACK: bypass 'i0.wp.com' image CDN to ensure original images are loaded directly from host - this.pageCache = Array.isArray(pages) ? pages.map(page => page.replace(/\/i\d+\.wp\.com/, '')) : pages; + this.pageCache = Array.isArray(pages) ? pages.map(page => page.legacy.replace(/\/i\d+\.wp\.com/, '')) : pages; } else { error = new Error(`There was no content found for '${this.title}', make sure it is accessible (login, purchase, ...)!`); } @@ -126,4 +126,4 @@ export default class Chapter extends EventTarget { } ); } } -} \ No newline at end of file +}