diff --git a/blocks/DotNetUtils.cs b/blocks/DotNetUtils.cs index 23f79a37..893ebb47 100644 --- a/blocks/DotNetUtils.cs +++ b/blocks/DotNetUtils.cs @@ -278,8 +278,12 @@ namespace de4dot.blocks { } } + public static bool isDelegate(TypeReference type) { + return type != null && (type.FullName == "System.Delegate" || type.FullName == "System.MulticastDelegate"); + } + public static bool isDelegateType(TypeDefinition type) { - return type != null && type.BaseType != null && type.BaseType.FullName == "System.MulticastDelegate"; + return type != null && isDelegate(type.BaseType); } public static bool isSameAssembly(TypeReference type, string assembly) {