Skip to content

Commit 729c98b

Browse files
committed
further type safety
1 parent fc0b9c5 commit 729c98b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

utils/config/config.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,15 @@ func transformChildrenUnderArray(config *koanf.Koanf, root string, subPath strin
197197

198198
log.Dev(utils.ToJson(tmp.All()))
199199

200-
transformed = append(transformed, tmp.All()["item"].(map[string]any))
200+
item := tmp.Get("item")
201+
202+
if item != nil {
203+
itemMap, ok := item.(map[string]any)
204+
205+
if ok {
206+
transformed = append(transformed, itemMap)
207+
}
208+
}
201209
}
202210

203211
config.Load(confmap.Provider(map[string]any{

0 commit comments

Comments
 (0)