🐛 Fix NPE

This commit is contained in:
Daniel 2024-10-21 23:52:02 +08:00
parent f708e99a74
commit 0d1c62a4e4
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -96,8 +96,10 @@ func GetBackmentionDoc(defID, refTreeID, keyword string, containChildren bool) (
trees := filesys.LoadTrees(mentionBlockIDs) trees := filesys.LoadTrees(mentionBlockIDs)
for id, tree := range trees { for id, tree := range trees {
backlink := buildBacklink(id, tree, mentionKeywords, luteEngine) backlink := buildBacklink(id, tree, mentionKeywords, luteEngine)
if nil != backlink {
ret = append(ret, backlink) ret = append(ret, backlink)
} }
}
return return
} }
@ -133,8 +135,10 @@ func GetBacklinkDoc(defID, refTreeID, keyword string, containChildren bool) (ret
keywords = append(keywords, keyword) keywords = append(keywords, keyword)
} }
backlink := buildBacklink(linkRef.ID, refTree, keywords, luteEngine) backlink := buildBacklink(linkRef.ID, refTree, keywords, luteEngine)
if nil != backlink {
ret = append(ret, backlink) ret = append(ret, backlink)
} }
}
return return
} }