diff --git a/knecht.go b/knecht.go index 80700a1..ccebfc3 100644 --- a/knecht.go +++ b/knecht.go @@ -116,6 +116,9 @@ func GetUserData(username string) (*User, []byte, error) { return nil, nil, err } } + if userJikan.Data.MalID == 0 { + return nil, nil, fmt.Errorf("user returned empty object: %s", username) + } // convert to user user = UserConvert(&userJikan) data, err = json.Marshal(&user)