Skip to content

Commit

Permalink
Translate field to annotation only when not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Alena Prokharchyk committed Feb 26, 2018
1 parent 2399924 commit 50be08f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/mapper/annotation_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 50be08f

Please sign in to comment.