summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vm/comtoclrcall.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm/comtoclrcall.cpp b/src/vm/comtoclrcall.cpp
index 5c275f025e..d2573262c9 100644
--- a/src/vm/comtoclrcall.cpp
+++ b/src/vm/comtoclrcall.cpp
@@ -782,7 +782,7 @@ extern "C" UINT64 __stdcall COMToCLRWorker(Thread *pThread, ComMethodFrame* pFra
#ifndef _TARGET_X86_
ErrorExit:
- if (pThread->PreemptiveGCDisabled())
+ if (pThread != nullptr && pThread->PreemptiveGCDisabled())
pThread->EnablePreemptiveGC();
// The call failed so we need to report an error to the caller.