mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Ensure WC()->payment_gateways
is not null
This commit is contained in:
parent
e383759e20
commit
055ffa9370
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue