Generated mail from the hub wont have $model->errors defined
This commit is contained in:
parent
924d760c79
commit
49e40f4fb8
@ -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');
|
||||
});
|
||||
|
||||
|
@ -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');
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user