Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: components/autofill/content/browser/wallet/wallet_client.cc

Issue 100743006: Fix DCHECK() when updating instruments with no phone number. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/content/browser/wallet/wallet_client.cc
diff --git a/components/autofill/content/browser/wallet/wallet_client.cc b/components/autofill/content/browser/wallet/wallet_client.cc
index 30fd6186abc7d722691239ed852b332db559d0f7..6f39021db95a4d3665a8b9d3fda6bb11bec0f215 100644
--- a/components/autofill/content/browser/wallet/wallet_client.cc
+++ b/components/autofill/content/browser/wallet/wallet_client.cc
@@ -408,8 +408,7 @@ void WalletClient::SaveToWallet(scoped_ptr<Instrument> instrument,
instrument->address()->phone_number());
} else {
DCHECK(instrument->address() ||
- (instrument->expiration_month() > 0 &&
- instrument->expiration_year() > 0));
+ instrument->expiration_differs_from_server());
request_dict.SetString(kUpgradedInstrumentIdKey,
instrument->object_id());
@@ -422,8 +421,8 @@ void WalletClient::SaveToWallet(scoped_ptr<Instrument> instrument,
instrument->address()->ToDictionaryWithoutID().release());
}
- if (instrument->expiration_month() > 0 &&
- instrument->expiration_year() > 0) {
+ if (instrument->expiration_differs_from_server()) {
+ // Updating expiration date requires a CVC.
DCHECK(!instrument->card_verification_number().empty());
request_dict.SetInteger(kInstrumentExpMonthKey,
instrument->expiration_month());

Powered by Google App Engine
This is Rietveld 408576698