Fatal error: Call to a member function getBody() on null

Published 3 months ago by Oscuro

Hi, I would like you to help me solve this error..

Fatal error: Call to a member function getBody() on null in /profiles/o/os/osc/oscuro/oursecret.zz.com.ve/libraries/CBLib/GuzzleHttp/Adapter/Curl/CurlAdapter.php on line 94

lostdreamer_nl

Show the code where you are using Guzzle, something is going wrong there.

Oscuro

This is a Joomla website using the plugin Community Builder shows me this error after installing it.

Fatal error: Call to a member function getBody() on null in /profiles/o/os/osc/oscuro/oursecret.zz.com.ve/libraries/CBLib/GuzzleHttp/Adapter/Curl/CurlAdapter.php on line 94

Oscuro
    if ($info['curl_result']) {
        $this->handleError($transaction, $info, $handle);
    } else {
        $this->releaseEasyHandle($handle);
        if ($body = $transaction->getResponse()->getBody()) {   ---> This is line 94
            $body->seek(0);
        }
        RequestEvents::emitComplete($transaction, $info);
    }

    return $transaction->getResponse();
}
lostdreamer_nl

@Oscuro This is a laravel forum, not joomla, I dont think you'll get much Joomla information here.

The part of the code you're showing now is part of the Guzzle library, trust me, it's been tested and is working fine.

The problem is that some other code (probably Joomla / Joomla plugin code) is calling the Guzzle library to do something, and that is where it's going wrong.

Do you have a stack trace of when you get that fatal error? From the stacktrace we can find out where the actuall error is coming from.

Please sign in or create an account to participate in this conversation.