Merge pull request #29133 from woocommerce/fix/notice

Check if index value is set before accessing
This commit is contained in:
jonathansadowski 2021-02-15 16:55:37 -06:00 committed by GitHub
commit ea7c6700bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -747,7 +747,7 @@ class WC_Checkout {
$field_label = isset( $field['label'] ) ? $field['label'] : '';
if ( $validate_fieldset &&
'country' === $field['type'] &&
( isset( $field['type'] ) && 'country' === $field['type'] ) &&
! WC()->countries->country_exists( $data[ $key ] ) ) {
/* translators: ISO 3166-1 alpha-2 country code */
$errors->add( $key . '_validation', sprintf( __( "'%s' is not a valid country code.", 'woocommerce' ), $data[ $key ] ) );