MethodTable * pMT = GetGCSafeMethodTable();
_ASSERTE(pMT != NULL);
+ if (pMT == g_pFreeObjectMethodTable)
+ {
+ return NULL;
+ }
+
// Don't look at types that belong to an unloading AppDomain, or else
// pObj->GetGCSafeTypeHandle() can AV. For example, we encountered this AV when pObj
// was an array like this:
Module * pLoaderModule = pMTToCheck->GetLoaderModule();
- BaseDomain * pBaseDomain = pLoaderModule->GetDomain();
-
// Don't look up types that are unloading due to Collectible Assemblies. Haven't been
// able to find a case where we actually encounter objects like this that can cause
// problems; however, it seems prudent to add this protection just in case.