Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 支持间隔复习 https://github.com/siyuan-note/siyuan/issues/6710

Liang Ding9a1a69a3db47
diff --git a/kernel/model/flashcard.go b/kernel/model/flashcard.go
index bacb77684b..f3a5bf6609 100644
--- a/kernel/model/flashcard.go
+++ b/kernel/model/flashcard.go
@@ -151,7 +151,6 @@ func RemoveFlashcards(deckID string, blockIDs []string) (err error) {
return
}
- deck := Decks[deckID]
var rootIDs []string
blockRoots := map[string]string{}
for _, blockID := range blockIDs {
@@ -218,13 +217,16 @@ func RemoveFlashcards(deckID string, blockIDs []string) (err error) {
pushBroadcastAttrTransactions(trans)
}
- for _, blockID := range blockIDs {
- deck.RemoveCard(blockID)
- }
- err = deck.Save()
- if nil != err {
- logging.LogErrorf("save deck [%s] failed: %s", deckID, err)
- return
+ deck := Decks[deckID]
+ if nil != deck {
+ for _, blockID := range blockIDs {
+ deck.RemoveCard(blockID)
+ }
+ err = deck.Save()
+ if nil != err {
+ logging.LogErrorf("save deck [%s] failed: %s", deckID, err)
+ return
+ }
}
return
}