From a134f0adb4ce0d7fcebef00fb67a2e43134b0c9e Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 7 Nov 2024 16:50:43 +0800 Subject: [PATCH] :bug: Fix NPE https://ld246.com/article/1730909507718 --- kernel/sql/av.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/kernel/sql/av.go b/kernel/sql/av.go index ae34bf8b2..b84e490ba 100644 --- a/kernel/sql/av.go +++ b/kernel/sql/av.go @@ -261,12 +261,15 @@ func RenderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s } if nil != destAv { blocks := map[string]*av.Value{} - for _, blockValue := range destAv.GetBlockKeyValues().Values { - blocks[blockValue.BlockID] = blockValue - } - for _, blockID := range cell.Value.Relation.BlockIDs { - if val := blocks[blockID]; nil != val { - cell.Value.Relation.Contents = append(cell.Value.Relation.Contents, val) + blockValues := destAv.GetBlockKeyValues() + if nil != blockValues { + for _, blockValue := range blockValues.Values { + blocks[blockValue.BlockID] = blockValue + } + for _, blockID := range cell.Value.Relation.BlockIDs { + if val := blocks[blockID]; nil != val { + cell.Value.Relation.Contents = append(cell.Value.Relation.Contents, val) + } } } }