Skip to content

Commit b865e2b

Browse files
Merge pull request #98 from shiftstack/fix_no_github
Address case where person has no Github handle
2 parents c78d0fa + 53133ff commit b865e2b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/team/team.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ func Load(peopleYAML, teamYAML io.Reader) ([]Person, error) {
7777
// PersonByJiraName returns the first person in the slice with the given Jira
7878
// name. The returned boolean is false if not found.
7979
func PersonByJiraName(people []Person, jiraName string) (Person, bool) {
80+
if jiraName == "" {
81+
return Person{}, false
82+
}
8083
for i := range people {
8184
if people[i].Jira == jiraName {
8285
return people[i], true
@@ -88,6 +91,9 @@ func PersonByJiraName(people []Person, jiraName string) (Person, bool) {
8891
// PersonByGithubHandle returns the first person in the slice with the given
8992
// Github handle. The returned boolean is false if not found.
9093
func PersonByGithubHandle(people []Person, githubHandle string) (Person, bool) {
94+
if githubHandle == "" {
95+
return Person{}, false
96+
}
9197
for i := range people {
9298
if people[i].Github == githubHandle {
9399
return people[i], true

0 commit comments

Comments
 (0)