encoder: only create empty map when target exists

This commit is contained in:
Thomas Pelletier
2021-04-08 19:40:34 -04:00
parent f2378983d9
commit ca41df4a59
+1 -1
View File
@@ -114,7 +114,7 @@ func (d *decoder) fromParser(p *parser, v interface{}) error {
found = true
case ast.Table:
current, found, err = d.scopeWithKey(root, node.Key())
if err == nil {
if err == nil && found {
// In case this table points to an interface,
// make sure it at least holds something that
// looks like a table. Otherwise the information