From 60148a3b652918772aa3e72d0c1a0a45659273f2 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Tue, 21 Nov 2023 14:57:44 +0100 Subject: [PATCH] check if user is available --- integration/class-webfinger.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/integration/class-webfinger.php b/integration/class-webfinger.php index 177b417..c9dd565 100644 --- a/integration/class-webfinger.php +++ b/integration/class-webfinger.php @@ -30,6 +30,10 @@ class Webfinger { public static function add_user_discovery( $array, $resource, $user ) { $user = User_Collection::get_by_id( $user->ID ); + if ( ! $user || is_wp_error( $user ) ) { + return $array; + } + $array['links'][] = array( 'rel' => 'self', 'type' => 'application/activity+json',