fix interface convertion for null virtual field

This commit is contained in:
Pavel Merzlyakov 2023-11-23 17:36:02 +03:00
parent 17d8186616
commit aebe6bc644
1 changed files with 6 additions and 4 deletions

View File

@ -603,10 +603,12 @@ func (s *{{ name|default(s.name) }}) ReadFields(reader meta.Reader) error {
return err
}
} else {
{{ fname }} = v.(I{{ type.name }})
{% if has_table_token %}
s.changedFields.SetChanged("{{ alias }}")
{% endif %}
if v != nil {
{{ fname }} = v.(I{{ type.name }})
{% if has_table_token %}
s.changedFields.SetChanged("{{ alias }}")
{% endif %}
}
}
{% else %}
if err := reader.BeginContainer("{{ alias }}"); err != nil {