Commit 88e7696e authored by Vasilii Sukhanov's avatar Vasilii Sukhanov Committed by Commit Bot

Fix crash in PasswordFormManager::SavePendingToStore.

PasswordFormManager::CreatePendingCredentials is complicated and it's possible
that we want to update a credential but can't find it by username in |best_matches|.
The CL changes the DCHECK into an 'if'. At this point it doesn't make sense to invest
into this class more time.

Bug: 961252
Change-Id: I61ea449cb8b035c72faae7268eb377fc687f7d8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1602638Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658704}
parent 903703ba
......@@ -1049,8 +1049,8 @@ void PasswordFormManager::SavePendingToStore(bool update) {
if (!pending_credentials_.IsFederatedCredential()) {
auto updated_password_it =
best_matches_.find(pending_credentials_.username_value);
DCHECK(best_matches_.end() != updated_password_it);
old_password = updated_password_it->second->password_value;
if (updated_password_it != best_matches_.end())
old_password = updated_password_it->second->password_value;
}
form_saver_->Update(pending_credentials_, matches, old_password);
......
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