An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: Fix NPE
Daniel973f99b690a0
diff --git a/kernel/model/backlink.go b/kernel/model/backlink.goindex 2fbb899c20..9ab52c9602 100644--- a/kernel/model/backlink.go+++ b/kernel/model/backlink.go@@ -483,6 +483,10 @@ func GetBacklink(id, keyword, mentionKeyword string, beforeLen int, containChild}paragraphParents := sql.GetBlocks(paragraphParentIDs)for _, p := range paragraphParents {+ if nil == p {+ continue+ }+if "i" == p.Type || "h" == p.Type {linkRefs = append(linkRefs, fromSQLBlock(p, keyword, beforeLen))processedParagraphs.Add(p.ID)@@ -589,6 +593,10 @@ func buildLinkRefs(defRootID string, refs []*sql.Ref, keywords []string) (ret []originalRefBlockIDs = map[string]string{}processedParagraphs := hashset.New()for _, parent := range paragraphParents {+ if nil == parent {+ continue+ }+if "NodeListItem" == parent.Type || "NodeBlockquote" == parent.Type || "NodeSuperBlock" == parent.Type {refBlock := parentRefParagraphs[parent.ID]if nil == refBlock {diff --git a/kernel/model/blockinfo.go b/kernel/model/blockinfo.goindex d739d42ad4..c68ef1717d 100644--- a/kernel/model/blockinfo.go+++ b/kernel/model/blockinfo.go@@ -624,6 +624,10 @@ func buildBacklinkListItemRefs(refDefs []*RefDefs) (originalRefBlockIDs map[striluteEngine := util.NewLute()processedParagraphs := hashset.New()for _, parent := range paragraphParents {+ if nil == parent {+ continue+ }+if "NodeListItem" == parent.Type || "NodeBlockquote" == parent.Type || "NodeSuperBlock" == parent.Type {refBlock := parentRefParagraphs[parent.ID]if nil == refBlock {