From 9bbc7aa2ab2618f634a2921ce25f5b08845ade0d Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 25 Jan 2021 21:57:01 +0700 Subject: [PATCH] check if ScreenName in response is empty instead of Name, since Name can be unset by user. --- profile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile.go b/profile.go index 4de2356..4b02273 100644 --- a/profile.go +++ b/profile.go @@ -51,7 +51,7 @@ func (s *Scraper) GetProfile(username string) (Profile, error) { return Profile{}, fmt.Errorf("rest_id not found") } - if jsn.Data.User.Legacy.Name == "" { + if jsn.Data.User.Legacy.ScreenName == "" { return Profile{}, fmt.Errorf("either @%s does not exist or is private", username) }