@@ -198,7 +198,8 @@ class CreditHistory extends ActiveRecordCommon | |||
} | |||
$newCredit = $userProducer->credit ; | |||
if($oldCredit > $creditLimitReminder && $newCredit <= $creditLimitReminder) { | |||
if(!is_null($creditLimitReminder) && | |||
$oldCredit > $creditLimitReminder && $newCredit <= $creditLimitReminder) { | |||
$user = User::findOne($this->id_user) ; | |||
$producer = Producer::findOne($this->id_producer) ; | |||
Yii::$app->mailer->compose( |