diff --git a/app/Models/Address.php b/app/Models/Address.php index c5db405..5d74813 100644 --- a/app/Models/Address.php +++ b/app/Models/Address.php @@ -321,7 +321,7 @@ class Address extends Model */ public function getNetmail(): ?Packet { - if (($x=Netmail::whereIn('tftn_id',$this->children->pluck('id')->push($this->id)) + if (($x=Netmail::whereIn('tftn_id',(($x=$this->children) ? $x->pluck('id') : collect())->push($this->id)) ->where(function($q) { return $q->whereNull('sent') ->orWhere('sent',FALSE);