facebook / facebook-php-business-sdk

PHP SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
833 stars 516 forks source link

Request exception - getErrorData with empty error_data fix #525

Closed ODAEL closed 4 years ago

ODAEL commented 4 years ago

Sometimes we are experiencing some warnings in SDK: array_key_exists() expects parameter 2 to be array, null given

It occurs in RequestException::idx method, when field error_data in response from your API is set and has null value. Thus, first argument of outer idx call in RequestException::144 is also null.

I propose to add fallback for $error_data['error_data'] === null.