diff --git a/app/components/CardsList.svelte b/app/components/CardsList.svelte index 7f92f524..bcf9aec6 100644 --- a/app/components/CardsList.svelte +++ b/app/components/CardsList.svelte @@ -640,7 +640,7 @@ const docs: OCRDocument[] = []; let doc; documents.forEach((d, index) => { - if (d.selected) { + if (d.doc && d.selected) { doc = d.doc; docs.push(doc); selected.push(...doc.pages); diff --git a/app/components/DocumentsList.svelte b/app/components/DocumentsList.svelte index 386cb5ea..0ffc3dcb 100644 --- a/app/components/DocumentsList.svelte +++ b/app/components/DocumentsList.svelte @@ -540,7 +540,7 @@ const docs: OCRDocument[] = []; let doc; documents.forEach((d, index) => { - if (d.selected) { + if (d.doc && d.selected) { doc = d.doc; docs.push(doc); selected.push(...doc.pages);