Skip to content

Commit

Permalink
Fix a panic for invalid sharing (#4459)
Browse files Browse the repository at this point in the history
  • Loading branch information
nono authored Sep 5, 2024
2 parents 4a7c868 + 833f23a commit 621c4e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions model/sharing/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ func (s *Sharing) DelegateDiscovery(inst *instance.Instance, state, cozyURL stri
v.Add("state", state)
v.Add("url", cozyURL)
body := []byte(v.Encode())
if len(s.Credentials) == 0 {
return "", ErrInvalidSharing
}
c := &s.Credentials[0]
opts := &request.Options{
Method: http.MethodPost,
Expand Down

0 comments on commit 621c4e3

Please sign in to comment.