Commit 6c15a508 authored by Rayan Kanso's avatar Rayan Kanso Committed by Commit Bot

[Contacts] Check whether context is valid before sharing contacts.

Bug: 985695
Change-Id: Ie6dfa5717219e06a5b7188e50c88b25b32ef69e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726049
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Auto-Submit: Rayan Kanso <rayankans@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682283}
parent fa1777a4
...@@ -135,6 +135,13 @@ void ContactsManager::OnContactsSelected( ...@@ -135,6 +135,13 @@ void ContactsManager::OnContactsSelected(
ScriptPromiseResolver* resolver, ScriptPromiseResolver* resolver,
base::Optional<Vector<mojom::blink::ContactInfoPtr>> contacts) { base::Optional<Vector<mojom::blink::ContactInfoPtr>> contacts) {
ScriptState* script_state = resolver->GetScriptState(); ScriptState* script_state = resolver->GetScriptState();
if (!script_state->ContextIsValid()) {
// This can happen if the page is programmatically redirected while
// contacts are still being chosen.
return;
}
ScriptState::Scope scope(script_state); ScriptState::Scope scope(script_state);
contact_picker_in_use_ = false; contact_picker_in_use_ = false;
......
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