Skip to content

Commit

Permalink
Fixing null $body
Browse files Browse the repository at this point in the history
  • Loading branch information
nuradiyana committed Mar 7, 2023
1 parent 3e17c39 commit 16e2093
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ private function getAccessToken(): void
/** @var array<array-key, string> $body */
$body = \json_decode((string) $response->getBody(), true);

Assert::keyExists($body, 'access_token');
if(\is_array($body)) {
Assert::keyExists($body, 'access_token');

$this->accessToken = $body['access_token'];
$this->accessToken = $body['access_token'];
}
}
}

Expand Down

0 comments on commit 16e2093

Please sign in to comment.