diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index 060ea33690f8..7daa9bbaa25c 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -1598,7 +1598,7 @@ PerThreadData::runtimeFromMainThread() inline JSRuntime * PerThreadData::runtimeIfOnOwnerThread() { - return CurrentThreadCanAccessRuntime(runtime_) ? runtime_ : nullptr; + return (runtime_ && CurrentThreadCanAccessRuntime(runtime_)) ? runtime_ : nullptr; } inline bool