diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/class-wpcom-admin-bar.php b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/class-wpcom-admin-bar.php index bb9bcb5e8fd32..d4aedf14478f5 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/class-wpcom-admin-bar.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/class-wpcom-admin-bar.php @@ -60,12 +60,7 @@ class WPCOM_Admin_Bar extends \WP_Admin_Bar { * } */ public function add_node( $args ) { - // Ensure $args is an array. - if ( is_object( $args ) ) { - $args = (array) $args; - } - - if ( empty( $args['href'] ) ) { + if ( ! is_array( $args ) || empty( $args['href'] ) ) { parent::add_node( $args ); return; }