Check *properly* if property exists to prevent PHP notice.
This commit is contained in:
kristuff 2021-09-18 21:41:42 +02:00
commit c4b5c65598

View file

@ -110,7 +110,7 @@ class ApiResponse
*/
public function errors(): array
{
return ($this->decodedResponse && $this->decodedResponse->errors) ? $this->decodedResponse->errors : [];
return ($this->decodedResponse && property_exists($this->decodedResponse, 'errors')) ? $this->decodedResponse->errors : [];
}
/**