Skip to content

Commit

Permalink
Merge pull request #203 from hyunsooda/nilcheck-added
Browse files Browse the repository at this point in the history
[Test] Nil check added
  • Loading branch information
fatih committed Jul 18, 2023
2 parents 6de8581 + 0a87ecc commit d5c210c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions color.go
Expand Up @@ -405,6 +405,12 @@ func (c *Color) isNoColorSet() bool {

// Equals returns a boolean value indicating whether two colors are equal.
func (c *Color) Equals(c2 *Color) bool {
if c == nil && c2 == nil {
return true
}
if c == nil || c2 == nil {
return false
}
if len(c.params) != len(c2.params) {
return false
}
Expand Down

0 comments on commit d5c210c

Please sign in to comment.