Skip to content

Commit 7585d72

Browse files
added a response check
1 parent 6ba8ac6 commit 7585d72

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/MsGraphAdmin.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ protected function guzzle($type, $request, $data = [])
189189
],
190190
'body' => json_encode($data),
191191
]);
192+
193+
if ($resonse == null) {
194+
return null;
195+
}
192196

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

@@ -204,6 +208,10 @@ protected static function dopost($url, $params)
204208
try {
205209
$client = new Client;
206210
$response = $client->post($url, ['form_params' => $params]);
211+
212+
if ($resonse == null) {
213+
return null;
214+
}
207215

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

0 commit comments

Comments
 (0)