Check for null methodhandle before checking if the method is in the same version...
authorFadi Hanna <fadim@microsoft.com>
Mon, 15 Apr 2019 23:25:16 +0000 (16:25 -0700)
committerJan Kotas <jkotas@microsoft.com>
Mon, 15 Apr 2019 23:25:16 +0000 (16:25 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/ee41ee41bcf5f6c1d77a261fa7cae469475b268a

src/coreclr/src/zap/zapinfo.cpp

index 066eb39..21ce5f5 100644 (file)
@@ -3864,7 +3864,7 @@ BOOL ZapInfo::pInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method,
         return TRUE; 
 #endif
 
-    if (IsReadyToRunCompilation() && !m_pImage->GetCompileInfo()->IsInCurrentVersionBubble(m_pEEJitInfo->getMethodModule(method)))
+    if (IsReadyToRunCompilation() && method != NULL && !m_pImage->GetCompileInfo()->IsInCurrentVersionBubble(m_pEEJitInfo->getMethodModule(method)))
     {
         // FUTURE: ZapSig::EncodeMethod does not yet handle cross module references for ReadyToRun
         // See zapsig.cpp around line 1217.