Error 500 when calling Rest API
-
Hello everyone.
Since the latest update, I am getting an error with some calls to the REST API.
My site is hosted on siteground and the Siteground optimizer plugin encounters erros when trying to connect to the Rest API.
This shows on my error_log after a failed call to domain.com/wp-json/siteground-optimizer/v1/fetch-options
[20-May-2021 19:56:54 UTC] PHP Fatal error: Uncaught Error: Call to a member function needs_shipping() on null in /home/customer/www/domain.com/public_html/wp-content/plugins/woocommerce-gateway-amazon-payments-advanced/includes/class-wc-gateway-amazon-payments-advanced.php:1572
Is there a solution other than editing the plugin code to check if WC()->cart exists on this line?
$needs_shipping = WC()->cart->needs_shipping();
thanks in advance.
- The topic ‘Error 500 when calling Rest API’ is closed to new replies.