Check for null methods

This commit is contained in:
de4dot 2011-10-31 00:08:38 +01:00
parent 35005a1a51
commit 11781b2875

View File

@ -327,7 +327,7 @@ namespace de4dot.blocks {
public static IList<string> getCodeStrings(MethodDefinition method) {
var strings = new List<string>();
if (method.HasBody) {
if (method != null && method.Body != null) {
foreach (var instr in method.Body.Instructions) {
if (instr.OpCode.Code == Code.Ldstr)
strings.Add((string)instr.Operand);