Remove uneccessary logging, null checking

This commit is contained in:
Andrew Morgan 2018-06-05 16:09:00 +01:00
parent 62d47cfc75
commit cd607d7b3b

View file

@ -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