Index: third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp |
diff --git a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp |
index 25c7a74f52714a0c22a98ec95e68607c0c6a6f74..f58d57c1ad37334dd6c4f227507aba1e1a0107f6 100644 |
--- a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp |
+++ b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp |
@@ -40,7 +40,8 @@ class GlobalFetchImpl final |
const RequestInfo& input, |
const Dictionary& init, |
ExceptionState& exceptionState) override { |
- if (!scriptState->contextIsValid()) { |
+ ExecutionContext* executionContext = m_fetchManager->getExecutionContext(); |
+ if (!scriptState->contextIsValid() || !executionContext) { |
// TODO(yhirano): Should this be moved to bindings? |
exceptionState.throwTypeError("The global scope is shutting down."); |
return ScriptPromise(); |
@@ -53,10 +54,8 @@ class GlobalFetchImpl final |
if (exceptionState.hadException()) |
return ScriptPromise(); |
- if (ExecutionContext* executionContext = |
- m_fetchManager->getExecutionContext()) |
- InspectorInstrumentation::willSendXMLHttpOrFetchNetworkRequest( |
- executionContext, r->url()); |
+ InspectorInstrumentation::willSendXMLHttpOrFetchNetworkRequest( |
+ executionContext, r->url()); |
return m_fetchManager->fetch(scriptState, r->passRequestData(scriptState)); |
} |