Generated mail from the hub wont have $model->errors defined

This commit is contained in:
Deon George 2024-05-21 23:30:48 +10:00
parent 924d760c79
commit 49e40f4fb8
2 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ final class Echomail extends Model implements Packet
parent::boot();
static::creating(function($model) {
if ($model->errors->count())
if (isset($model->errors) && $model->errors->count())
throw new \Exception('Cannot save, validation errors exist');
});

View File

@ -86,7 +86,7 @@ final class Netmail extends Model implements Packet
parent::boot();
static::creating(function($model) {
if ($model->errors->count())
if (isset($model->errors) && $model->errors->count())
throw new \Exception('Cannot save, validation errors exist');
});