From 72fb8044f94eb3033ef06c9aa1ca4f72ea92a7b0 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 8 Aug 2021 21:49:58 +1000 Subject: [PATCH] Fix for identifying children for netmail packets --- app/Models/Address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);