From a1bc2b12d292c8982668a9832a6453cb2cdbba7f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 3 Oct 2023 15:02:47 +0200 Subject: [PATCH] Skip comment that no longer exist See https://www.woltlab.com/community/thread/301877-fehler-attempt-to-read-property-objectid-on-null-durch-gel%C3%B6schten-pinnwandkommen/ --- .../event/ProfileCommentResponseUserActivityEvent.class.php | 4 ++++ .../activity/event/ProfileCommentUserActivityEvent.class.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentResponseUserActivityEvent.class.php b/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentResponseUserActivityEvent.class.php index fcab9e4f8f..46f528bcdf 100644 --- a/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentResponseUserActivityEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentResponseUserActivityEvent.class.php @@ -32,6 +32,10 @@ class ProfileCommentResponseUserActivityEvent extends SingletonFactory implement // fetch users $userIDs = $users = []; foreach ($this->comments as $comment) { + if ($comment === null) { + continue; + } + $userIDs[] = $comment->objectID; } if (!empty($userIDs)) { diff --git a/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentUserActivityEvent.class.php b/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentUserActivityEvent.class.php index 69baa360f9..926dfb7ca1 100644 --- a/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentUserActivityEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentUserActivityEvent.class.php @@ -37,6 +37,10 @@ class ProfileCommentUserActivityEvent extends SingletonFactory implements IUserA // fetch users $userIDs = $users = []; foreach ($comments as $comment) { + if ($comment === null) { + continue; + } + $userIDs[] = $comment->objectID; } if (!empty($userIDs)) { -- 2.20.1