| @@ -20,9 +20,15 @@ | ||
| 20 | 20 | * |
| 21 | 21 | * @return \Activitypub\Activity\Base_Object|\WP_Error The Actor or WP_Error on failure. |
| 22 | 22 | */ |
| 23 | 23 | public function to_object() { |
| 24 | - return $this->transform_object_properties( Actors::get_by_id( $this->item->ID ) ); | |
| 24 | + $activity_object = $this->transform_object_properties( Actors::get_by_id( $this->item->ID ) ); | |
| 25 | + | |
| 26 | + if ( \is_wp_error( $activity_object ) ) { | |
| 27 | + return $activity_object; | |
| 28 | + } | |
| 29 | + | |
| 30 | + return $activity_object; | |
| 25 | 31 | } |
| 26 | 32 | |
| 27 | 33 | /** |
| 28 | 34 | * Get the Actor ID. |