Commit 7658f69c authored by zauberstuhl's avatar zauberstuhl
Browse files

Fix Crypto.Valid accessing a nil pointer

This happens if the mail address does not exist in the database
parent 2db73180
......@@ -41,6 +41,9 @@ func (c *Crypto) Valid(ctx util.Context, email, pass string) (uuid string, valid
su, err = c.Users.SensitiveUserByEmail(ctx, tx, email)
return err
})
if su == nil && err == nil {
err = fmt.Errorf("crypto valid: no records found for given mail address: %s", email)
}
if err != nil {
return
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment