Skip to content

Commit c11246a

Browse files
authored
Update FileMakerConnection.php
The $response variable is not checked before method getBody() is called It happens to me when working on a local environment without an internet connection to the server. The $response variable is null and it crashes without generating a specific exception. This small fix allows the program to continue and finally returns a ConnectionException
1 parent 1603f30 commit c11246a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Services/FileMakerConnection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ protected function retryMiddleware()
687687
$log_message = 'Connection Error: ' . $exception->getMessage();
688688
}
689689

690-
$contents = $response->getBody()->getContents();
690+
$contents = $response?->getBody()->getContents();
691691
$contents = json_decode($contents, true);
692692
if ($response && $response->getStatusCode() !== 200 && $contents !== null) {
693693
$code = (int) Arr::first(Arr::pluck(Arr::get($contents, 'messages'), 'code'));

0 commit comments

Comments
 (0)