Skip to content

Commit

Permalink
json_decode to array
Browse files Browse the repository at this point in the history
  • Loading branch information
n7studios committed Apr 12, 2024
1 parent d0167b6 commit 9a5c6a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/class-convertkit-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2292,7 +2292,7 @@ private function request( $endpoint, $method = 'get', $params = array(), $retry_
$body = wp_remote_retrieve_body( $result );

// If the body is null i.e. a 204 No Content, don't attempt to JSON decode it.
$response = ( ! empty( $body ) ? json_decode( $body ) : null );
$response = ( ! empty( $body ) ? json_decode( $body, true ) : null );

// Return a WP_Error if the HTTP response code is a 5xx code.
// The API respose won't contain an error message, so we use this class' error messages.
Expand Down

0 comments on commit 9a5c6a0

Please sign in to comment.