Skip to content

Commit 3c6f941

Browse files
committed
Do not create map if resultMap is empty
1 parent 7a8619d commit 3c6f941

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

confmap/confmap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ func unmarshalerEmbeddedStructsHookFunc() mapstructure.DecodeHookFuncValue {
506506
return nil, err
507507
}
508508
resultMap := conf.ToStringMap()
509-
if fromAsMap == nil {
509+
if fromAsMap == nil && len(resultMap) > 0 {
510510
fromAsMap = make(map[string]any, len(resultMap))
511511
}
512512
for k, v := range resultMap {

0 commit comments

Comments
 (0)