From be13f7a011ca86d3abab2028623efe9367e4b3d1 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Wed, 22 May 2024 20:39:24 +0200 Subject: [PATCH] Fix nil pointer derefernce when QueryAccountByPassword --- userapi/internal/user_api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/userapi/internal/user_api.go b/userapi/internal/user_api.go index a126dc871..fd73bf62f 100644 --- a/userapi/internal/user_api.go +++ b/userapi/internal/user_api.go @@ -939,11 +939,12 @@ func (a *UserInternalAPI) QueryAccountByPassword(ctx context.Context, req *api.Q return nil case bcrypt.ErrHashTooShort: // user exists, but probably a passwordless account return nil - default: + case nil: res.Exists = true res.Account = acc return nil } + return err } func (a *UserInternalAPI) SetDisplayName(ctx context.Context, localpart string, serverName spec.ServerName, displayName string) (*authtypes.Profile, bool, error) {