Don't access transient when receiving a WP_Error

This commit is contained in:
Alex Kirk 2022-12-15 11:37:00 +01:00
parent bf335b2be6
commit 034ba0554d
2 changed files with 5 additions and 1 deletions

View file

@ -118,6 +118,10 @@ function get_remote_metadata_by_actor( $actor ) {
return null;
}
if ( is_wp_error( $actor ) ) {
return $actor;
}
$metadata = \get_transient( 'activitypub_' . $actor );
if ( $metadata ) {

View file

@ -68,7 +68,7 @@ class Friends_Feed_Parser_ActivityPub extends \Friends\Feed_Parser {
*/
public function update_feed_details( $feed_details ) {
$meta = \Activitypub\get_remote_metadata_by_actor( $feed_details['url'] );
if ( ! $meta && is_wp_error( $meta ) ) {
if ( ! $meta || is_wp_error( $meta ) ) {
return $meta;
}