From 4595021cb133e40945661e141326a3edb6f3adf2 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Mon, 16 Feb 2026 12:32:21 +1100 Subject: [PATCH] CreateConversation: don't crash on comment with no user A comment can have "no" user, usually from the "ghost" placeholder user when the originally commenter deleted their Github account. Use the GetUser() and GetLogin() accessors rather than dereferencing User directly to avoid a segfault. Fixes #306. Signed-off-by: Rob Norris --- pkg/hubbub/item.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/hubbub/item.go b/pkg/hubbub/item.go index 05833e1..b561f0d 100644 --- a/pkg/hubbub/item.go +++ b/pkg/hubbub/item.go @@ -127,7 +127,7 @@ func (h *Engine) createConversation(i provider.IItem, cs []*provider.Comment, ag if !i.GetClosedAt().IsZero() && c.Created.After(i.GetClosedAt().Add(30*time.Second)) { klog.V(1).Infof("#%d: comment after closed on %s: %+v", co.ID, i.GetClosedAt(), c) co.ClosedCommentsTotal++ - seenClosedCommenters[*c.User.Login] = true + seenClosedCommenters[c.User.GetLogin()] = true } if c.User.GetLogin() == i.GetUser().GetLogin() { @@ -161,9 +161,9 @@ func (h *Engine) createConversation(i provider.IItem, cs []*provider.Comment, ag } } - if !seenCommenters[*c.User.Login] { + if !seenCommenters[c.User.GetLogin()] { co.Commenters = append(co.Commenters, c.User) - seenCommenters[*c.User.Login] = true + seenCommenters[c.User.GetLogin()] = true } }