From 5f332489d198db0850aa0957f0032b017e6ab7bb Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Thu, 15 Feb 2018 18:13:14 +0000 Subject: [PATCH] Fix creating of Facebook alterative content --- app/Models/Note.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/Note.php b/app/Models/Note.php index 73f504a7..cbbc5335 100644 --- a/app/Models/Note.php +++ b/app/Models/Note.php @@ -370,7 +370,7 @@ class Note extends Model } /** - * Show a specific form of the note for facebook. + * Show a specific form of the note for Facebook. * * That is we swap the contacts names for their known Facebook usernames. * @@ -378,6 +378,10 @@ class Note extends Model */ public function getFacebookContentAttribute(): ?string { + if ($this->contacts === null) { + return null; + } + if (count($this->contacts) === 0) { return null; }