Skip to content

Commit 1d0fa24

Browse files
committed
First check if REST response is array
Resolves a fatal error with WooCommerce
1 parent 592fa54 commit 1d0fa24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/bcc-login/includes/class-bcc-login-visibility.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ function on_rest_pre_echo_response( $response, $object, $request ) {
207207
$user_level = (int) $this->_client->get_user_level_based_on_claims();
208208
$user_groups = $this->get_current_user_groups();
209209

210-
if ( array_key_exists('code', $response) && $response['code'] == 'rest_cookie_invalid_nonce' )
210+
if ( is_array($response) && array_key_exists('code', $response) && $response['code'] == 'rest_cookie_invalid_nonce' )
211211
return $response;
212212

213213
if ( $route == '/wp/v2/search' ) {

0 commit comments

Comments
 (0)