From 0b410cd505ed44f242ef37400d9f5573d3dc0239 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 3 Jan 2023 18:52:17 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/6977 --- app/src/card/makeCard.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/card/makeCard.ts b/app/src/card/makeCard.ts index e2b62707f..3e21e9f1d 100644 --- a/app/src/card/makeCard.ts +++ b/app/src/card/makeCard.ts @@ -217,7 +217,7 @@ const viewCards = (deckID: string, title: string) => { breadcrumbDocName: true }, }); - getArticle(edit, dialog.element.querySelector(".b3-list-item--focus").getAttribute("data-id")); + getArticle(edit, dialog.element.querySelector(".b3-list-item--focus")?.getAttribute("data-id")); const previousElement = dialog.element.querySelector('[data-type="previous"]'); const nextElement = dialog.element.querySelector('[data-type="next"]'); const listElement = dialog.element.querySelector(".b3-list--background"); @@ -242,7 +242,7 @@ const viewCards = (deckID: string, title: string) => { } nextElement.nextElementSibling.nextElementSibling.textContent = `${pageIndex}/${cardsResponse.data.pageCount}`; listElement.innerHTML = renderViewItem(cardsResponse.data.blocks); - getArticle(edit, dialog.element.querySelector(".b3-list-item--focus").getAttribute("data-id")); + getArticle(edit, dialog.element.querySelector(".b3-list-item--focus")?.getAttribute("data-id")); }); event.stopPropagation(); event.preventDefault(); @@ -258,7 +258,7 @@ const viewCards = (deckID: string, title: string) => { } nextElement.nextElementSibling.nextElementSibling.textContent = `${pageIndex}/${cardsResponse.data.pageCount}`; listElement.innerHTML = renderViewItem(cardsResponse.data.blocks); - getArticle(edit, dialog.element.querySelector(".b3-list-item--focus").getAttribute("data-id")); + getArticle(edit, dialog.element.querySelector(".b3-list-item--focus")?.getAttribute("data-id")); }); event.stopPropagation(); event.preventDefault();