Skip to content

Commit be985f0

Browse files
committed
fix issue when we were checking the error code on a boolean value
1 parent fc18717 commit be985f0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

inc/rest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,12 @@ public function connect( WP_REST_Request $request ) {
274274
$data = $request->connect( $api_key );
275275

276276
if ( $data === false || is_wp_error( $data ) ) {
277-
if ( $data->get_error_code() === 'domain_not_accessible' ) {
278-
return $this->response( $data->get_error_message(), 400 );
279-
}
277+
280278
$extra = '';
281279
if ( is_wp_error( $data ) ) {
280+
if ( $data->get_error_code() === 'domain_not_accessible' ) {
281+
return $this->response( $data->get_error_message(), 400 );
282+
}
282283
/**
283284
* Error from api.
284285
*

0 commit comments

Comments
 (0)