Skip to content

Commit

Permalink
Fix invalid memory address or nil pointer dereference error
Browse files Browse the repository at this point in the history
  • Loading branch information
babarot committed Nov 26, 2018
1 parent 46b10ca commit 16a37e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ func (g *LabelService) Get(owner, repo string, label Label) (Label, error) {
if err != nil {
return Label{}, err
}
description := ""
if fetchedLabel.Description != nil {
description = *fetchedLabel.Description
}
return Label{
Name: *fetchedLabel.Name,
Description: *fetchedLabel.Description,
Description: description,
Color: *fetchedLabel.Color,
}, nil
}
Expand Down

0 comments on commit 16a37e0

Please sign in to comment.