From 8abaac6d79804e4fdcb5246f63f962d31e73eb06 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 7 May 2020 09:17:16 -0400 Subject: [PATCH] Account for missing location value in ActivityPub\Receiver --- src/Protocol/ActivityPub/Receiver.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 2f5332bef..384f5b595 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -1059,12 +1059,13 @@ class Receiver $location = JsonLD::fetchElement($object, 'as:location', 'as:name', '@type', 'as:Place'); $location = JsonLD::fetchElement($location, 'location', '@value'); - - // Some AP software allow formatted text in post location, so we run all the text converters we have to boil - // down to HTML and then finally format to plaintext. - $location = Markdown::convert($location); - $location = BBCode::convert($location); - $location = HTML::toPlaintext($location); + if ($location) { + // Some AP software allow formatted text in post location, so we run all the text converters we have to boil + // down to HTML and then finally format to plaintext. + $location = Markdown::convert($location); + $location = BBCode::convert($location); + $location = HTML::toPlaintext($location); + } $object_data['sc:identifier'] = JsonLD::fetchElement($object, 'sc:identifier', '@value'); $object_data['diaspora:guid'] = JsonLD::fetchElement($object, 'diaspora:guid', '@value');