From eca04497d7b96f6f421e351d8e25965bfec7b531 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Mon, 25 Dec 2023 00:33:40 +0800 Subject: [PATCH] :art: Add Relation column to database table view https://github.com/siyuan-note/siyuan/issues/9888 --- kernel/model/attribute_view.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 933ba5d49..d96fb75c7 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -2173,8 +2173,10 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string, oldBoundBlockID := val.BlockID var oldRelationBlockIDs []string if av.KeyTypeRelation == val.Type { - for _, bID := range val.Relation.BlockIDs { - oldRelationBlockIDs = append(oldRelationBlockIDs, bID) + if nil != val.Relation { + for _, bID := range val.Relation.BlockIDs { + oldRelationBlockIDs = append(oldRelationBlockIDs, bID) + } } } data, err := gulu.JSON.MarshalJSON(valueData)