diff --git a/de4dot.code/deobfuscators/ValueInlinerBase.cs b/de4dot.code/deobfuscators/ValueInlinerBase.cs
index d9f31d34..e9494c5d 100644
--- a/de4dot.code/deobfuscators/ValueInlinerBase.cs
+++ b/de4dot.code/deobfuscators/ValueInlinerBase.cs
@@ -17,6 +17,7 @@
along with de4dot. If not, see .
*/
+using System;
using System.Collections.Generic;
using Mono.Cecil;
using Mono.Cecil.Cil;
@@ -43,6 +44,10 @@ namespace de4dot.code.deobfuscators {
}
public void add(MethodDefinition method, Func handler) {
+ if (method == null)
+ return;
+ if (decrypterMethods.find(method) != null)
+ throw new ApplicationException(string.Format("Handler for method {0:X8} has already been added", method.MetadataToken.ToInt32()));
if (method != null)
decrypterMethods.add(method, handler);
}