You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method is assuming that the success property will always be passed as part of the content body. Pipedrive does not pass this key on unsuccessful response codes (404 in this use case) so this will cause a status 500 from the dependency.
Where is the cause of the issue
File
vendor/devio/pipedrive/src/Http/Response.php
Codeblock
Line 53
/** * Check if the request was successful. * * @return bool */publicfunctionisSuccess()
{
if (! $this->getContent()) {
returnfalse;
}
return$this->getContent()->success;
}
Resolution
You can either use isset in the conditional statement or the return.
As there may be at some point a success property passed for status codes, it's probably best to use it in the if statement for this use case.
/** * Check if the request was successful. * * @return bool */publicfunctionisSuccess()
{
if (! $this->getContent() || ! isset($this->getContent()->success)) {
returnfalse;
}
return$this->getContent()->success;
}
The text was updated successfully, but these errors were encountered:
What is the issue:
The method is assuming that the
success
property will always be passed as part of the content body. Pipedrive does not pass this key on unsuccessful response codes (404
in this use case) so this will cause a status500
from the dependency.Where is the cause of the issue
File
Codeblock
Resolution
You can either use
isset
in the conditional statement or the return.As there may be at some point a
success
property passed for status codes, it's probably best to use it in the if statement for this use case.The text was updated successfully, but these errors were encountered: