From 49fee4096acf3b823e66c359d18131e7d419dfb6 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Wed, 4 Nov 2020 13:14:33 +0000
Subject: [PATCH] Handle fatal error when attachment url is null

---
 src/Protocol/ActivityPub/Processor.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php
index ba18ec8720..5af712fc78 100644
--- a/src/Protocol/ActivityPub/Processor.php
+++ b/src/Protocol/ActivityPub/Processor.php
@@ -189,7 +189,7 @@ class Processor
 						}
 
 						$item['body'] .= "\n[video]" . $attach['url'] . '[/video]';
-					} else {
+					} elseif (!empty($attach['url'])) {
 						if (!empty($item['attach'])) {
 							$item['attach'] .= ',';
 						} else {
@@ -202,6 +202,8 @@ class Processor
 							$attach['mediaType'] ?? '',
 							$attach['name'] ?? ''
 						);
+					} else {
+						Logger::notice('Unknown attachment', ['attach' => $attach]);
 					}
 			}
 		}