[AW NS] Fix crash: execute error callback and early-out when io_thread_client is null.

Make sure to prevent crashes when io_thread_client is null,
at the time when InterceptedRequest::Restart is called.
There is a small amount of crash reports, see
crbug.com/953584, which indicate this case could arise
in special cases.

BUG=953584,841556

Cq-Include-Trybots: luci.chromium.try:android_mojo
Change-Id: I958fa4d622125a2d54ef99aee83a598f4cf46be5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1578751
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Tim Volodine <timvolodine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653652}
diff --git a/android_webview/browser/network_service/aw_proxying_url_loader_factory.cc b/android_webview/browser/network_service/aw_proxying_url_loader_factory.cc
index d73e3c1..f56c790 100644
--- a/android_webview/browser/network_service/aw_proxying_url_loader_factory.cc
+++ b/android_webview/browser/network_service/aw_proxying_url_loader_factory.cc
@@ -285,7 +285,11 @@
 void InterceptedRequest::Restart() {
   std::unique_ptr<AwContentsIoThreadClient> io_thread_client =
       GetIoThreadClient();
-  DCHECK(io_thread_client);
+
+  if (!io_thread_client) {
+    SendErrorAndCompleteImmediately(net::ERR_ABORTED);
+    return;
+  }
 
   if (ShouldBlockURL(request_.url, io_thread_client.get())) {
     SendErrorAndCompleteImmediately(net::ERR_ACCESS_DENIED);