Declaring type is null if it's already been removed
This commit is contained in:
parent
6be691ab6d
commit
87a8052cbe
|
@ -412,6 +412,8 @@ namespace de4dot.code.deobfuscators {
|
||||||
Log.indent();
|
Log.indent();
|
||||||
foreach (var cctor in emptyCctorsToRemove) {
|
foreach (var cctor in emptyCctorsToRemove) {
|
||||||
var type = cctor.DeclaringType;
|
var type = cctor.DeclaringType;
|
||||||
|
if (type == null)
|
||||||
|
continue;
|
||||||
if (type.Methods.Remove(cctor))
|
if (type.Methods.Remove(cctor))
|
||||||
Log.v("{0:X8}, type: {1} ({2:X8})",
|
Log.v("{0:X8}, type: {1} ({2:X8})",
|
||||||
cctor.MetadataToken.ToUInt32(),
|
cctor.MetadataToken.ToUInt32(),
|
||||||
|
@ -455,6 +457,8 @@ namespace de4dot.code.deobfuscators {
|
||||||
if (field == null)
|
if (field == null)
|
||||||
continue;
|
continue;
|
||||||
var type = field.DeclaringType;
|
var type = field.DeclaringType;
|
||||||
|
if (type == null)
|
||||||
|
continue;
|
||||||
if (type.Fields.Remove(field))
|
if (type.Fields.Remove(field))
|
||||||
Log.v("Removed field {0} ({1:X8}) (Type: {2}) (reason: {3})",
|
Log.v("Removed field {0} ({1:X8}) (Type: {2}) (reason: {3})",
|
||||||
Utils.removeNewlines(field),
|
Utils.removeNewlines(field),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user