Skip to content

Commit

Permalink
Fix: Uncaught TypeError
Browse files Browse the repository at this point in the history
Argument must be of type array.
\Psr\Http\Message\ServerRequestInterface::getParsedBody could be null|object|array
  • Loading branch information
githubjeka committed Feb 15, 2021
1 parent a2781e6 commit 7f85e21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Contact/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function contact(
): ResponseInterface {
$body = $request->getParsedBody();
$form = new ContactForm();
if (($request->getMethod() === Method::POST) && $form->load($body) && $form->validate($validator)) {
if (($request->getMethod() === Method::POST) && $form->load((array)$body) && $form->validate($validator)) {
$this->mailer->send($form, $request);

return $this->responseFactory
Expand Down

0 comments on commit 7f85e21

Please sign in to comment.