Skip to content

Commit 12bb062

Browse files
ndeloofglours
authored andcommitted
detect include misconfiguration
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 072aa64 commit 12bb062

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

loader/include.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ func loadIncludeConfig(source any) ([]types.IncludeConfig, error) {
3434
if source == nil {
3535
return nil, nil
3636
}
37-
configs := source.([]any)
37+
configs, ok := source.([]any)
38+
if !ok {
39+
return nil, fmt.Errorf("`include` must be a list, got %s", source)
40+
}
3841
for i, config := range configs {
3942
if v, ok := config.(string); ok {
4043
configs[i] = map[string]any{

0 commit comments

Comments
 (0)