Fix for identifying children for netmail packets

This commit is contained in:
Deon George 2021-08-08 21:49:58 +10:00
parent 5ca6c8126e
commit 72fb8044f9
1 changed files with 1 additions and 1 deletions

View File

@ -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);