From bff99358be72cc9ab7f683973c25e9a9dd2e933c Mon Sep 17 00:00:00 2001 From: arrow2nd <44780846+arrow2nd@users.noreply.github.com> Date: Mon, 23 Jan 2023 20:36:45 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=AD=98=E5=9C=A8=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=82=92=E9=96=8B=E3=81=8F=E3=81=A8=E8=90=BD=E3=81=A1=E3=82=8B?= =?UTF-8?q?=20#126?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user.go | 2 +- app/page_user.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/user.go b/api/user.go index 7cf969b..3a7740c 100644 --- a/api/user.go +++ b/api/user.go @@ -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) } } diff --git a/app/page_user.go b/app/page_user.go index daf6f77..ba3f514 100644 --- a/app/page_user.go +++ b/app/page_user.go @@ -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) } From 6266d60c1fd7a3caaa47c8860b4ef2d4cc3425a8 Mon Sep 17 00:00:00 2001 From: arrow2nd <44780846+arrow2nd@users.noreply.github.com> Date: Mon, 23 Jan 2023 20:40:17 +0900 Subject: [PATCH 2/2] =?UTF-8?q?docs(CHANGELOG):=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E7=82=B9=E3=82=92=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b94add..484f809 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +## [v2.2.1] - 2023-01-23 + +### Fixed + +- 存在しないユーザのページを開くと落ちる + ## [v2.2.0] - 2023-01-16 ### Added @@ -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