Skip to content

Commit

Permalink
fix: html form parse regression issue
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Oct 13, 2020
1 parent 216ea7f commit 6b07cbb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion selfservice/form/html_form.go
Expand Up @@ -179,7 +179,12 @@ func (c *HTMLForm) ParseError(err error) error {
default:
// The pointer can be ignored because if there is an error, we'll just use
// the empty field (global error).
for _, ee := range e.Causes {
var causes = e.Causes
if len(e.Causes) == 0 {
causes = []*jsonschema.ValidationError{e}
}

for _, ee := range causes {
pointer, _ := jsonschemax.JSONPointerToDotNotation(ee.InstancePtr)
c.AddMessage(text.NewValidationErrorGeneric(ee.Message), pointer)
}
Expand Down

0 comments on commit 6b07cbb

Please sign in to comment.