Make sure transformers exist (https://github.com/woocommerce/woocommerce-admin/pull/6987)
This commit is contained in:
parent
e2d9a8792a
commit
8983a4d371
|
@ -72,10 +72,12 @@ class OptionRuleProcessor implements RuleProcessorInterface {
|
|||
return false;
|
||||
}
|
||||
|
||||
foreach ( $rule->transformers as $transform_args ) {
|
||||
$transformer = TransformerService::create_transformer( $transform_args->use );
|
||||
if ( ! $transformer->validate( $transform_args->arguments ) ) {
|
||||
return false;
|
||||
if ( isset( $rule->transformers ) && is_array( $rule->transformers ) ) {
|
||||
foreach ( $rule->transformers as $transform_args ) {
|
||||
$transformer = TransformerService::create_transformer( $transform_args->use );
|
||||
if ( ! $transformer->validate( $transform_args->arguments ) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue