Index: chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
index 8af66f6bf65113cd0f56731dd682a907cac22d69..7dcc0c88a1810cb0b1fb653658b4c3298aa3a613 100644 |
--- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
+++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
@@ -413,21 +413,20 @@ bool CreditCardEditorViewController::ValidateModelAndSave() { |
autofill::CreditCard credit_card; |
credit_card.set_origin(autofill::kSettingsOrigin); |
+ if (!ValidateModel()) { |
+ return false; |
+ } |
+ |
for (const auto& field : text_fields()) { |
// ValidatingTextfield* is the key, EditorField is the value. |
DCHECK_EQ(autofill::CREDIT_CARD, |
autofill::AutofillType(field.second.type).group()); |
- if (field.first->invalid()) |
- return false; |
- |
credit_card.SetInfo(autofill::AutofillType(field.second.type), |
field.first->text(), locale); |
} |
for (const auto& field : comboboxes()) { |
// ValidatingCombobox* is the key, EditorField is the value. |
ValidatingCombobox* combobox = field.first; |
- if (combobox->invalid()) |
- return false; |
if (field.second.type == kBillingAddressType) { |
views::Combobox* address_combobox = static_cast<views::Combobox*>( |