瀏覽代碼

:bug: Fix NPE https://ld246.com/article/1730909507718

Daniel 8 月之前
父節點
當前提交
a134f0adb4
共有 1 個文件被更改,包括 9 次插入6 次删除
  1. 9 6
      kernel/sql/av.go

+ 9 - 6
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)
+								}
 							}
 						}
 					}