This commit is contained in:
James Read 2025-07-28 10:24:38 +01:00 committed by GitHub
parent d4fe9eaa79
commit 81ef166d78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View File

@ -103,12 +103,20 @@ func redactShellCommand(shellCommand string, arguments []config.ActionArgument,
}
func typecheckActionArgument(name string, value string, action *config.Action) error {
if name == "" {
return fmt.Errorf("argument name cannot be empty")
}
arg := action.FindArg(name)
if arg == nil {
return fmt.Errorf("action arg not defined: %v", name)
}
return typecheckActionArgumentFound(name, value, action, arg)
}
func typecheckActionArgumentFound(name string, value string, action *config.Action, arg *config.ActionArgument) error {
if value == "" {
return typecheckNull(arg)
}
@ -210,7 +218,7 @@ func typeSafetyCheckRegex(name string, value string, argumentType string) error
pattern, found = typecheckRegex[argumentType]
if !found {
return fmt.Errorf("argument type not implemented %v", argumentType)
return fmt.Errorf("argument type not implemented %v for arg: %v", argumentType, name)
}
}

View File

@ -44,6 +44,10 @@ class ArgumentForm extends window.HTMLElement {
}
}
if (arg.name === "") {
continue
}
ret.push({
name: arg.name,
value: arg.value