Do not initialize WC Pay promotion if spec is empty (https://github.com/woocommerce/woocommerce-admin/pull/8087)

This commit is contained in:
Moon 2021-12-27 00:29:51 -08:00 committed by GitHub
parent 61cdae82c4
commit ccd2495ff4
1 changed files with 4 additions and 1 deletions

View File

@ -24,7 +24,10 @@ class WCPaymentGatewayPreInstallWCPayPromotion extends \WC_Payment_Gateway {
* Constructor
*/
public function __construct() {
$wc_pay_spec = Init::get_wc_pay_promotion_spec();
$wc_pay_spec = Init::get_wc_pay_promotion_spec();
if ( ! $wc_pay_spec ) {
return;
}
$this->id = static::GATEWAY_ID;
$this->method_title = $wc_pay_spec->title;
if ( property_exists( $wc_pay_spec, 'sub_title' ) ) {