We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f49c10f commit 58f4c6aCopy full SHA for 58f4c6a
1 file changed
includes/class-api.php
@@ -1614,11 +1614,16 @@ private function exec( $url, $options ): bool {
1614
$this->status_code = 0;
1615
1616
if ( ! is_wp_error( $response ) ) {
1617
-
+ if ( empty( $response['body'] ) ) {
1618
+ constant_contact_maybe_log_it(
1619
+ 'Response error: ', implode( ":", $response['response'] )
1620
+ );
1621
+ return false;
1622
+ }
1623
$data = json_decode( $response['body'], true );
1624
$json_last_error = json_last_error();
1625
if ( JSON_ERROR_NONE !== $json_last_error ) {
- constant_contact_maybe_log_it( 'JSON Error: ', json_last_error_msg() );
1626
+ constant_contact_maybe_log_it( 'JSON error: ', json_last_error_msg() );
1627
}
1628
1629
// check if the body contains error
0 commit comments