浏览代码

fix(): fixed from db -> json

Torkel Ödegaard 9 年之前
父节点
当前提交
40b2f00dc5
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      pkg/components/simplejson/simplejson.go

+ 4 - 0
pkg/components/simplejson/simplejson.go

@@ -26,6 +26,10 @@ func (j *Json) FromDB(data []byte) error {
 }
 
 func (j *Json) ToDB() ([]byte, error) {
+	if j == nil || j.data == nil {
+		return nil, nil
+	}
+
 	return j.Encode()
 }