Skip to content

Commit d0631be

Browse files
authored
Fix ILVerify.ILVerifyTypeSystemContext.VerifyModuleName throws NullReferenceException (#63222)
Fixes #62711
1 parent 92c55cd commit d0631be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/coreclr/tools/ILVerification/ILVerifyTypeSystemContext.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ internal override ModuleDesc ResolveModule(IAssemblyDesc referencingModule, stri
5353
private EcmaModule ResolveAssemblyOrNetmodule(string simpleName, string verificationName, IAssemblyDesc containingAssembly, bool throwIfNotFound)
5454
{
5555
PEReader peReader = _resolver.Resolve(simpleName);
56-
if (peReader == null && throwIfNotFound)
56+
if (peReader == null)
5757
{
58-
throw new VerifierException("Assembly or module not found: " + simpleName);
58+
if (throwIfNotFound)
59+
throw new VerifierException("Assembly or module not found: " + simpleName);
60+
return null;
5961
}
6062
var module = GetModule(peReader, containingAssembly);
6163
VerifyModuleName(verificationName, module);

0 commit comments

Comments
 (0)