Merge pull request #1128 from woocommerce/PCP-1384-fatal-error-on-2-0-2-rc-1

Ensure `WC()->payment_gateways` is not null
This commit is contained in:
Emili Castells 2023-01-18 15:11:58 +01:00 committed by GitHub
commit eb4a60e503
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View file

@ -4,6 +4,7 @@
* Fix - Do not call PayPal get order by ID if it does not exist #1029
* Fix - Type check error conflict with German Market #1056
* Fix - Backend Storage for the PayPalRequestIdRepository does not scale #983
* Fix - Ensure WC()->payment_gateways is not null #1128
* Enhancement - Remove plugin data after uninstalling #1075
* Enhancement - Add FraudNet to all payments #1040
* Enhancement - Update "Standard Payments" tab settings #1065

View file

@ -99,6 +99,10 @@ class DisableGateways {
* @return bool
*/
private function disable_all_gateways() : bool {
if ( is_null( WC()->payment_gateways ) ) {
return false;
}
foreach ( WC()->payment_gateways->payment_gateways() as $gateway ) {
if ( PayPalGateway::ID === $gateway->id && $gateway->enabled !== 'yes' ) {
return true;

View file

@ -85,6 +85,7 @@ Follow the steps below to connect the plugin to your PayPal account:
* Fix - Do not call PayPal get order by ID if it does not exist #1029
* Fix - Type check error conflict with German Market #1056
* Fix - Backend Storage for the PayPalRequestIdRepository does not scale #983
* Fix - Ensure WC()->payment_gateways is not null #1128
* Enhancement - Remove plugin data after uninstalling #1075
* Enhancement - Add FraudNet to all payments #1040
* Enhancement - Update "Standard Payments" tab settings #1065