Call to a member function getStatusCode() on null in retryDecider method
Closed this issue · 0 comments
While the Shopify Api was not accessible in our VPN environment we experienced the following exception:
[2017-04-04 15:34:16] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Fatal error: Call to a member function getStatusCode() on null" at /vendor/zfr/zfr-shopify/src/ShopifyClient.php line 382 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Fatal error: Call to a member function getStatusCode() on null at /vendor/zfr/zfr-shopify/src/ShopifyClient.php:382)"}
It occurs here: https://github.com/zf-fr/zfr-shopify/blob/2.1.2/src/ShopifyClient.php#L382
I'm not sure why the $response
object is null, but as the method signature allows for a nullable $response
object I think it should be checked before using it.