From 0a87ecc21b5543e5fa4df05192143a16a341eab9 Mon Sep 17 00:00:00 2001 From: Hyunsoo Shin Date: Tue, 18 Jul 2023 22:49:57 +0900 Subject: [PATCH] [Test] Nil check added --- color.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/color.go b/color.go index affb721..4d8b711 100644 --- a/color.go +++ b/color.go @@ -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 }