diff --git a/Confuser.Protections/ReferenceProxy/StrongMode.cs b/Confuser.Protections/ReferenceProxy/StrongMode.cs index 2fdc7666d..2f0342eb9 100644 --- a/Confuser.Protections/ReferenceProxy/StrongMode.cs +++ b/Confuser.Protections/ReferenceProxy/StrongMode.cs @@ -329,7 +329,7 @@ public override void Finalize(RPContext ctx) { void EncodeField(object sender, ModuleWriterListenerEventArgs e) { var writer = (ModuleWriterBase)sender; - if (e.WriterEvent == ModuleWriterEvent.MDMemberDefRidsAllocated) { + if (e.WriterEvent == ModuleWriterEvent.MDMemberDefRidsAllocated && keyAttrs != null) { Dictionary> keyFuncs = keyAttrs .Where(entry => entry != null) .ToDictionary(entry => entry.Item1, entry => entry.Item2);