From 50be08fe26c69754f0211e17b538739b92e14ac1 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Mon, 26 Feb 2018 11:29:35 -0800 Subject: [PATCH] Translate field to annotation only when not nil --- types/mapper/annotation_field.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mapper/annotation_field.go b/types/mapper/annotation_field.go index 821621a3d..583a3e73e 100644 --- a/types/mapper/annotation_field.go +++ b/types/mapper/annotation_field.go @@ -38,7 +38,7 @@ func (e AnnotationField) FromInternal(data map[string]interface{}) { func (e AnnotationField) ToInternal(data map[string]interface{}) { v, ok := data[e.Field] - if ok { + if ok && v != nil { if e.Object || e.List { if bytes, err := json.Marshal(v); err == nil { v = string(bytes)