Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #127 from arrow2nd/fix-user-page
Browse files Browse the repository at this point in the history
fix user page
  • Loading branch information
arrow2nd authored Jan 23, 2023
2 parents 6a12bdc + 6266d60 commit 696f13f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

## [v2.2.1] - 2023-01-23

### Fixed

- 存在しないユーザのページを開くと落ちる

## [v2.2.0] - 2023-01-16

### Added
Expand Down Expand Up @@ -196,7 +202,8 @@

- リリースしました! 😸

[unreleased]: https://github.com/arrow2nd/nekome/compare/v2.2.0...HEAD
[unreleased]: https://github.com/arrow2nd/nekome/compare/v2.2.1...HEAD
[v2.2.1]: https://github.com/arrow2nd/nekome/compare/v2.2.0...v2.2.1
[v2.2.0]: https://github.com/arrow2nd/nekome/compare/v2.1.0...v2.2.0
[v2.1.0]: https://github.com/arrow2nd/nekome/compare/v2.0.10...v2.1.0
[v2.0.10]: https://github.com/arrow2nd/nekome/compare/v2.0.9...v2.0.10
Expand Down
2 changes: 1 addition & 1 deletion api/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (a *API) FetchUser(userNames []string) ([]*UserDictionary, error) {
func (a *API) fetchPinnedTweets(raw *twitter.UserRaw) (*twitter.TweetRaw, error) {
tweetIDs := []string{}
for _, user := range raw.Users {
if user.PinnedTweetID != "" {
if user != nil && user.PinnedTweetID != "" {
tweetIDs = append(tweetIDs, user.PinnedTweetID)
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/page_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (u *userPage) fetchProfile() error {
return err
}

if len(users) == 0 || users[0] == nil {
if len(users) == 0 || users[0] == nil || users[0].User == nil {
return fmt.Errorf("failed to get user profile: %w", err)
}

Expand Down

0 comments on commit 696f13f

Please sign in to comment.