return an empty list instead of an error if no result

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2025-09-25 19:15:16 +02:00
parent aa44e44409
commit e74f69daf7
3 changed files with 12 additions and 1 deletions
+4
View File
@@ -91,6 +91,10 @@ func GetGravatarProfiles(email string) (*[]GravatarProfile, error) {
}
defer resp.Body.Close()
if resp.StatusCode == 404 {
return &[]GravatarProfile{}, nil
}
if resp.StatusCode != 200 {
return nil, fmt.Errorf("no gravatar profile found (status %d)", resp.StatusCode)
}