Skip to content

Commit

Permalink
Fix global_stats type check
Browse files Browse the repository at this point in the history
  • Loading branch information
dkmyta committed Jul 30, 2024
1 parent e0b81a3 commit a241165
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions projects/packages/waf/src/class-waf-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ public static function get_global_stats( $refresh_from_wpcom = false ) {
$global_stats = self::get_global_stats_from_options();
}

// Ensure that $global_stats is the correct type
if ( ! is_array( $global_stats ) && ! ( $global_stats instanceof \WP_Error ) ) {
return new \WP_Error( 'unexpected_type', 'Unexpected type or null returned for global stats' );
}
// // Ensure that $global_stats is of the correct type
// if ( ( ! is_array( $global_stats ) && ! ( $global_stats instanceof \WP_Error ) ) ) {
// return new \WP_Error( 'unexpected_type', 'Unexpected type or null returned for global stats' );
// }

return $global_stats;
}
Expand Down

0 comments on commit a241165

Please sign in to comment.