Skip to content

Commit

Permalink
Bail if not an array
Browse files Browse the repository at this point in the history
  • Loading branch information
DustyReagan committed Jul 25, 2024
1 parent 7a85943 commit 1b4f6c1
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1b4f6c1

Please sign in to comment.