diff --git a/src/Gregwar/Captcha/CaptchaBuilder.php b/src/Gregwar/Captcha/CaptchaBuilder.php index 4d53639..1d43b2f 100644 --- a/src/Gregwar/Captcha/CaptchaBuilder.php +++ b/src/Gregwar/Captcha/CaptchaBuilder.php @@ -348,6 +348,11 @@ protected function writePhrase($image, $phrase, $font, $width, $height) $x = ($width - $textWidth) / 2; $y = ($height - $textHeight) / 2 + $size; + // Define a empty array when textColor is null + if(is_null($this->textColor)){ + $this->textColor = array(); + } + if (!$this->textColor) { $textColor = array($this->rand(0, 150), $this->rand(0, 150), $this->rand(0, 150)); } else {