Commit f916dc82 authored by jhawkins@chromium.org's avatar jhawkins@chromium.org

DOMUI: Gracefully a handle a NULL profile in the Autofill editor handler. This

can happen if we try to edit a profile that is in the process of being removed,
but for which we haven't been notified that it's removed yet.

BUG=69327
TEST=none

Review URL: http://codereview.chromium.org/6323012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72071 0039d316-1c4b-4281-b951-d872f2087c98
parent 1a28d9fc
......@@ -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().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment