Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to access array offset on value of type null #118

Open
Axel-AMGHAR opened this issue Dec 14, 2021 · 0 comments
Open

Trying to access array offset on value of type null #118

Axel-AMGHAR opened this issue Dec 14, 2021 · 0 comments

Comments

@Axel-AMGHAR
Copy link

Axel-AMGHAR commented Dec 14, 2021

  • BotMan Version: 2.6.1
  • PHP Version: 7.4.25
  • Messaging Service(s):
  • Cache Driver:
  • FacebookDriver: 1.11.0

Description:

Error when calling chatbot with FacebookDriver:

local.ERROR: Trying to access array offset on value of type null {"exception":"[object] (ErrorException(code: 0): Trying to access array offset on value of type null at .......vendor/botman/driver-facebook/src/FacebookDriver.php:516)

So in FacebookDriver:
$facebookResponse->getContent() return nothing
$facebookResponse->getStatusCode() = 500

protected function throwExceptionIfResponseNotOk(Response $facebookResponse)
{
    if ($facebookResponse->getStatusCode() !== 200) {
        $responseData = json_decode($facebookResponse->getContent(), true);
        throw new FacebookException('Error sending payload: '.$responseData['error']['message']);
    }
}

Steps To Reproduce:

Facebook driver tutorial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant