diff --git a/chrome/browser/actor/actor_navigation_throttle.cc b/chrome/browser/actor/actor_navigation_throttle.cc index ffc25626200d9..d9b3784664470 100644 --- a/chrome/browser/actor/actor_navigation_throttle.cc +++ b/chrome/browser/actor/actor_navigation_throttle.cc @@ -140,7 +140,17 @@ ActorNavigationThrottle::WillProcessResponse() { } if (!execution_engine_) { - return content::NavigationThrottle::PROCEED; + // The action-sequence-scoped WeakPtr was invalidated (the action sequence + // completed while this navigation was in flight). The ExecutionEngine + // itself is still alive for the duration of the task, so re-resolve it via + // task_id_ rather than failing open and skipping ShouldDeferNavigation(). + if (actor::ActorTask* task = + ActorKeyedService::Get(GetProfile())->GetTask(task_id_)) { + execution_engine_ = task->GetExecutionEngine().GetWeakPtr(); + } + if (!execution_engine_) { + return content::NavigationThrottle::CANCEL_AND_IGNORE; + } } content::NavigationThrottle::ThrottleAction action = execution_engine_->ShouldDeferNavigation(