Skip to content

Commit

Permalink
Fix null ptr dereference in github user name
Browse files Browse the repository at this point in the history
fixes #302

commit-id:56249a32
  • Loading branch information
ejoffe committed Apr 12, 2023
1 parent 867ff5d commit ef4abd8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions github/githubclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"bytes"
"context"
"fmt"
"gopkg.in/yaml.v3"
"net/url"
"os"
"path"
"path/filepath"
"regexp"
"strings"

"gopkg.in/yaml.v3"

"github.com/ejoffe/spr/config"
"github.com/ejoffe/spr/git"
"github.com/ejoffe/spr/github"
Expand Down Expand Up @@ -264,11 +265,14 @@ func (c *client) GetAssignableUsers(ctx context.Context) []github.RepoAssignee {
}

for _, node := range *resp.Repository.AssignableUsers.Nodes {
users = append(users, github.RepoAssignee{
user := github.RepoAssignee{
ID: node.Id,
Login: node.Login,
Name: *node.Name,
})
}
if node.Name != nil {
user.Name = *node.Name
}
users = append(users, user)
}
if !resp.Repository.AssignableUsers.PageInfo.HasNextPage {
break
Expand Down

0 comments on commit ef4abd8

Please sign in to comment.