From 560058f7fa168084b30d8a03fc822b8d795c0a8b Mon Sep 17 00:00:00 2001 From: Nut He <18328704+hetao92@users.noreply.github.com> Date: Tue, 29 Dec 2020 16:51:18 +0800 Subject: [PATCH] feat: return empty tag list after getting null --- service/dao/dao.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/service/dao/dao.go b/service/dao/dao.go index d01217b..18f8f02 100644 --- a/service/dao/dao.go +++ b/service/dao/dao.go @@ -75,10 +75,10 @@ func getVertexInfo(valWarp *nebula.ValueWrapper, data map[string]common.Any) (ma } id := node.GetID() data["vid"] = id - tags := node.GetTags() - data["tags"] = tags + tags := make([]string, 0) properties := make(map[string]map[string]common.Any) - for _, tagName := range tags { + for _, tagName := range node.GetTags() { + tags = append(tags, tagName) props, err := node.Properties(tagName) if err != nil { return nil, err @@ -93,6 +93,7 @@ func getVertexInfo(valWarp *nebula.ValueWrapper, data map[string]common.Any) (ma } properties[tagName] = _props } + data["tags"] = tags data["properties"] = properties return data, nil }