Check for null on COM to CLR call if error occurs during thread instance get.
authorAaron Robinson <arobins@microsoft.com>
Wed, 21 Nov 2018 19:07:41 +0000 (11:07 -0800)
committerAaron Robinson <arobins@microsoft.com>
Wed, 21 Nov 2018 19:07:41 +0000 (11:07 -0800)
Commit migrated from https://github.com/dotnet/coreclr/commit/fac2d42c8c1546c87317675728e048961004a2ee

src/coreclr/src/vm/comtoclrcall.cpp

index 5c275f0..d257326 100644 (file)
@@ -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.