Index: tool/input_sdk/private/isolate_helper.dart |
diff --git a/tool/input_sdk/private/isolate_helper.dart b/tool/input_sdk/private/isolate_helper.dart |
index c0d7367acc296a730c307fa714ff9b2505afdb5e..b3e6635483d6a445242207e27e73b89b536f7532 100644 |
--- a/tool/input_sdk/private/isolate_helper.dart |
+++ b/tool/input_sdk/private/isolate_helper.dart |
@@ -756,7 +756,9 @@ class IsolateNatives { |
if (Primitives.isD8) return computeThisScriptD8(); |
if (Primitives.isJsshell) return computeThisScriptJsshell(); |
// A worker has no script tag - so get an url from a stack-trace. |
- if (_globalState.isWorker) return computeThisScriptFromTrace(); |
+ if (_globalState != null && _globalState.isWorker) { |
+ return computeThisScriptFromTrace(); |
+ } |
return null; |
} |