From 9ae7b9cf01e86578bf6550dcccc37b90297dbb64 Mon Sep 17 00:00:00 2001 From: Art4 Date: Mon, 4 Nov 2024 11:58:08 +0000 Subject: [PATCH] Fix warnings in Receiver.php --- src/Protocol/ActivityPub/Receiver.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 12fd91b7cf..e31b8fb3d6 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -1896,8 +1896,14 @@ class Receiver } $object_data['unlisted'] = in_array(-1, $object_data['receiver']); - unset($object_data['receiver'][-1]); - unset($object_data['reception_type'][-1]); + + if (array_key_exists(-1, $object_data['receiver'])) { + unset($object_data['receiver'][-1]); + } + + if (array_key_exists(-1, $object_data['reception_type'])) { + unset($object_data['reception_type'][-1]); + } return $object_data; }