return not found when user is nil

This commit is contained in:
Asim Aslam
2022-03-02 10:38:30 +00:00
parent 7ab702dd5b
commit fe76efde75

View File

@@ -174,6 +174,10 @@ func (s *User) Read(ctx context.Context, req *pb.ReadRequest, rsp *pb.ReadRespon
account, err = s.domain.SearchByEmail(ctx, req.Email)
}
if account == nil {
return errors.NotFound("user.read", "user not found")
}
rsp.Account = account
if err != nil {
return err