diff --git a/src/coreclr/tools/Common/Compiler/TypeMapMetadata.cs b/src/coreclr/tools/Common/Compiler/TypeMapMetadata.cs index 541445ea041bda..3a32246c5f6592 100644 --- a/src/coreclr/tools/Common/Compiler/TypeMapMetadata.cs +++ b/src/coreclr/tools/Common/Compiler/TypeMapMetadata.cs @@ -442,8 +442,6 @@ public static TypeMapMetadata CreateFromAssembly(EcmaAssembly assembly, ModuleDe continue; } - CustomAttributeValue attrValue = attr.DecodeValue(new TypeMapCustomAttributeTypeProvider(currentAssembly)); - TypeDesc typeMapGroup = type.Instantiation[0]; Map typeMapState; @@ -483,6 +481,8 @@ public static TypeMapMetadata CreateFromAssembly(EcmaAssembly assembly, ModuleDe try { + CustomAttributeValue attrValue = attr.DecodeValue(new TypeMapCustomAttributeTypeProvider(currentAssembly)); + switch (attrKind) { case TypeMapAttributeKind.TypeMapAssemblyTarget: