Skip to content

Commit

Permalink
added a response check
Browse files Browse the repository at this point in the history
  • Loading branch information
daveismynamecom authored Aug 15, 2019
1 parent 6ba8ac6 commit 7585d72
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/MsGraphAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ protected function guzzle($type, $request, $data = [])
],
'body' => json_encode($data),
]);

if ($resonse == null) {
return null;
}

return json_decode($response->getBody()->getContents(), true);

Expand All @@ -204,6 +208,10 @@ protected static function dopost($url, $params)
try {
$client = new Client;
$response = $client->post($url, ['form_params' => $params]);

if ($resonse == null) {
return null;
}

return json_decode($response->getBody()->getContents());

Expand Down

0 comments on commit 7585d72

Please sign in to comment.