Skip to content

Commit b08e215

Browse files
gloursndeloof
authored andcommitted
be sure path property exists in env_file attribut definition
Signed-off-by: Guillaume Lours <[email protected]>
1 parent b723f6a commit b08e215

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

override/uncity.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,15 @@ func portIndexer(y any, p tree.Path) (string, error) {
198198
return "", nil
199199
}
200200

201-
func envFileIndexer(y any, _ tree.Path) (string, error) {
201+
func envFileIndexer(y any, p tree.Path) (string, error) {
202202
switch value := y.(type) {
203203
case string:
204204
return value, nil
205205
case map[string]any:
206-
return value["path"].(string), nil
206+
if pathValue, ok := value["path"]; ok {
207+
return pathValue.(string), nil
208+
}
209+
return "", fmt.Errorf("environment path attribut %s is missing", p)
207210
}
208211
return "", nil
209212
}

0 commit comments

Comments
 (0)