Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Add nil check for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFerr committed Feb 21, 2024
1 parent 38b8f3e commit 4b56dcf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/signalmeow/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ func (cli *Client) fetchProfileByID(ctx context.Context, signalID uuid.UUID) (*P
}

func (cli *Client) DownloadUserAvatar(ctx context.Context, avatarPath string, profileKey *libsignalgo.ProfileKey) ([]byte, error) {
if profileKey == nil {
return nil, fmt.Errorf("failed to prepare request: profileKey is nil")
}
username, password := cli.Store.BasicAuthCreds()
opts := &web.HTTPReqOpt{
Host: web.CDN1Hostname,
Expand Down

0 comments on commit 4b56dcf

Please sign in to comment.