]> git.mxchange.org Git - friendica.git/commitdiff
Handle fatal error when attachment url is null
authorMichael <heluecht@pirati.ca>
Wed, 4 Nov 2020 13:14:33 +0000 (13:14 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 4 Nov 2020 13:14:33 +0000 (13:14 +0000)
src/Protocol/ActivityPub/Processor.php

index ba18ec8720fd223a4210bdaafb8e4c4ad2a4ebb5..5af712fc7893a61979c5490e293d14ec0c8a08b5 100644 (file)
@@ -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]);
                                        }
                        }
                }