Skip to content

Commit

Permalink
fix: panic while get gist failed (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
k8scat committed May 8, 2023
1 parent e7a5e03 commit 9f42c4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sync/gist.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (g GistClient) GetSnippet() (*Snippet, error) {

gist, res, err := g.Client.Gists.Get(context.Background(), g.ID)
if err != nil {
if res.StatusCode == 404 {
if res != nil && res.StatusCode == 404 {
return nil, errors.Wrapf(err, "No gist ID (%s)", g.ID)
}
return nil, errors.Wrapf(err, "Failed to get gist")
Expand Down

0 comments on commit 9f42c4d

Please sign in to comment.