Skip to content

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

:art: Improve adding rows of the filtered database table view https://github.com/siyuan-note/siyuan/issues/10025

Danielbab2a294985d
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index f82705c708..0f907a5662 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -901,13 +901,19 @@ func updateAttributeViewColRollup(operation *Operation) (err error) {
KeyID: operation.KeyID,
}
- data := operation.Data.(map[string]interface{})
- calcData, err := gulu.JSON.MarshalJSON(data["calc"])
- if nil != err {
- return
- }
- if err = gulu.JSON.UnmarshalJSON(calcData, &rollUpKey.Rollup.Calc); nil != err {
- return
+ if nil != operation.Data {
+ data := operation.Data.(map[string]interface{})
+ if nil != data["calc"] {
+ calcData, jsonErr := gulu.JSON.MarshalJSON(data["calc"])
+ if nil != jsonErr {
+ err = jsonErr
+ return
+ }
+ if jsonErr = gulu.JSON.UnmarshalJSON(calcData, &rollUpKey.Rollup.Calc); nil != jsonErr {
+ err = jsonErr
+ return
+ }
+ }
}
err = av.SaveAttributeView(attrView)