Skip to content

Commit

Permalink
fix: add error check when there is no assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcipher committed Feb 19, 2024
1 parent 9ac8c1a commit 22feccb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/kaf/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 22feccb

Please # to comment.