fix(backend): avoid nil user in GetProfile (userToProfile panic in profile handler test)
This commit is contained in:
parent
4be5988f8e
commit
a9009de366
1 changed files with 1 additions and 1 deletions
|
|
@ -202,7 +202,7 @@ func (s *UserService) GetProfile(userID uuid.UUID, requesterID *uuid.UUID) (*Pro
|
|||
|
||||
// Cache miss - fetch from database
|
||||
user, err := s.userRepo.GetByID(userID.String())
|
||||
if err != nil {
|
||||
if err != nil || user == nil {
|
||||
return nil, fmt.Errorf("user not found")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue