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

Impossible to access an attribute ("statusPhrase") on a null variable #86

Closed
soullivaneuh opened this issue Dec 28, 2016 · 1 comment · Fixed by #87
Closed

Impossible to access an attribute ("statusPhrase") on a null variable #86

soullivaneuh opened this issue Dec 28, 2016 · 1 comment · Fixed by #87

Comments

@soullivaneuh
Copy link
Contributor

soullivaneuh commented Dec 28, 2016

On some Guzzle exception, like a connection refused, the response is empty.

It causes this error on the profiler:

Impossible to access an attribute ("statusPhrase") on a null variable.

From this template part:

<span class="response">{{ message.response.statusPhrase }} ({{ message.response.statusCode }})</span>

Related exception:

ConnectException {#2378 ▼
  -request: Request {#2363 ▶}
  -response: null
  -handlerContext: array:28 [▶]
  #message: "cURL error 7: Failed to connect to slack port 80: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)"
  #code: 0
  #file: "/code/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php"
  #line: 186
  -trace: {▶}
}

We should check if the response exists before trying to get any property of it.

@florianpreusner
Copy link
Member

Thanks for the fix!
Released new version 5.2.3: https://github.com/8p/GuzzleBundle/releases/tag/v5.2.3

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

Successfully merging a pull request may close this issue.

2 participants