Skip to content

Commit

Permalink
[Test] Nil check added
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunsooda committed Jul 18, 2023
1 parent 6de8581 commit 0a87ecc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions color.go
Original file line number Diff line number Diff line change
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 0a87ecc

Please sign in to comment.