Torkel Ödegaard 9 лет назад
Родитель
Сommit
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) {
 func (j *Json) ToDB() ([]byte, error) {
+	if j == nil || j.data == nil {
+		return nil, nil
+	}
+
 	return j.Encode()
 	return j.Encode()
 }
 }