Skip to content

Commit

Permalink
fix: 想法为空时获取本章想法失败
Browse files Browse the repository at this point in the history
  • Loading branch information
Higurashi-kagome committed Apr 9, 2024
1 parent 3481dd1 commit 5c40327
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/worker/worker-popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,12 @@ export async function copyThought(isAll?: boolean) {
})
} else {
const chapUid = curChapUid
const thoughtsInAChap = thoughts.get(chapUid)!
res += getTempRes(thoughtsInAChap, chapUid)
const thoughtsInAChap = thoughts.get(chapUid)
if (thoughtsInAChap) {
res += getTempRes(thoughtsInAChap, chapUid)
}
}
if (!res) sendAlertMsg({ text: '该书无想法', icon: 'warning' })
if (!res) sendAlertMsg({ text: '未找到想法', icon: 'warning' })
else copy(res)
}

Expand Down

0 comments on commit 5c40327

Please sign in to comment.