Skip to content

Commit 05682eb

Browse files
committed
only call cb if it's not nil
1 parent 5358b71 commit 05682eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/todos/todos.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ func (t *ToDos) FindBlame(repo *git.Repository, from *object.Commit, cb func(*ob
113113
}(todo, commit, errs)
114114
}
115115
wg.Wait()
116-
cb(commit, len(newRemainingTodos))
116+
if cb != nil {
117+
cb(commit, len(newRemainingTodos))
118+
}
117119
prevCommit = commit
118120
remainingTodos = newRemainingTodos
119121
return nil

0 commit comments

Comments
 (0)