From cd607d7b3bea6def4d0f9b6f2f18569b00863261 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 5 Jun 2018 16:09:00 +0100 Subject: [PATCH] Remove uneccessary logging, null checking --- .../clientapi/auth/storage/accounts/accounts_table.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/auth/storage/accounts/accounts_table.go b/src/github.com/matrix-org/dendrite/clientapi/auth/storage/accounts/accounts_table.go index 7b7c997a..11f82498 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/auth/storage/accounts/accounts_table.go +++ b/src/github.com/matrix-org/dendrite/clientapi/auth/storage/accounts/accounts_table.go @@ -130,15 +130,16 @@ func (s *accountsStatements) selectAccountByLocalpart( stmt := s.selectAccountByLocalpartStmt err := stmt.QueryRowContext(ctx, localpart).Scan(&localpartPtr, &appserviceIDPtr) if err != nil { - log.WithError(err).Error("Unable to retrieve user from the db") + switch err { + case sql.ErrNoRows: + default: + log.WithError(err).Error("Unable to retrieve user from the db") + } return nil, err } if appserviceIDPtr.Valid { acc.AppServiceID = appserviceIDPtr.String } - if localpartPtr.Valid { - acc.Localpart = localpartPtr.String - } acc.UserID = userutil.MakeUserID(localpart, s.serverName) acc.ServerName = s.serverName