From 22feccb953434541515cfef66c5a6137d0259a17 Mon Sep 17 00:00:00 2001 From: jackcipher Date: Mon, 19 Feb 2024 16:42:59 +0800 Subject: [PATCH] fix: add error check when there is no assignment --- cmd/kaf/topic.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/kaf/topic.go b/cmd/kaf/topic.go index a92c115..ad1ff18 100644 --- a/cmd/kaf/topic.go +++ b/cmd/kaf/topic.go @@ -368,7 +368,10 @@ var lagCmd = &cobra.Command{ var lagInfo = make(map[string]int64) for _, v := range groupsInfo { for _, member := range v.Members { - assignment, _ := member.GetMemberAssignment() + assignment, err := member.GetMemberAssignment() + if err != nil || assignment == nil { + continue + } if _, exist := assignment.Topics[topic]; exist { var sum int64 resp, _ := admin.ListConsumerGroupOffsets(v.GroupId, assignment.Topics)