Index: chrome/browser/dom_ui/options/autofill_options_handler.cc |
diff --git a/chrome/browser/dom_ui/options/autofill_options_handler.cc b/chrome/browser/dom_ui/options/autofill_options_handler.cc |
index d82982ba4e64131c3d200dd62cc16c0385479c71..3f82e536b46f5b061e90978235c4d52e7fbec684 100644 |
--- a/chrome/browser/dom_ui/options/autofill_options_handler.cc |
+++ b/chrome/browser/dom_ui/options/autofill_options_handler.cc |
@@ -241,7 +241,14 @@ void AutoFillOptionsHandler::LoadAddressEditor(const ListValue* args) { |
} |
AutoFillProfile* profile = personal_data_->GetProfileByGUID(guid); |
- DCHECK(profile); |
+ if (!profile) { |
+ // There is a race where a user can click once on the close button and |
+ // quickly click again on the list item before the item is removed (since |
+ // the list is not updated until the model tells the list an item has been |
+ // removed). This will activate the editor for a profile that has been |
+ // removed. Do nothing in that case. |
+ return; |
+ } |
// TODO(jhawkins): This is hacky because we can't send DictionaryValue |
// directly to CallJavascriptFunction(). |
@@ -288,7 +295,14 @@ void AutoFillOptionsHandler::LoadCreditCardEditor(const ListValue* args) { |
} |
CreditCard* credit_card = personal_data_->GetCreditCardByGUID(guid); |
- DCHECK(credit_card); |
+ if (!credit_card) { |
+ // There is a race where a user can click once on the close button and |
+ // quickly click again on the list item before the item is removed (since |
+ // the list is not updated until the model tells the list an item has been |
+ // removed). This will activate the editor for a profile that has been |
+ // removed. Do nothing in that case. |
+ return; |
+ } |
// TODO(jhawkins): This is hacky because we can't send DictionaryValue |
// directly to CallJavascriptFunction(). |