From 59ba32f0285aa6d6b367e6283cae9268e8947fed Mon Sep 17 00:00:00 2001 From: jeff Date: Sat, 7 Mar 2015 16:00:44 -0500 Subject: match/unmatch button works --- src/cuchaz/enigma/bytecode/LocalVariableRenamer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/cuchaz/enigma/bytecode') diff --git a/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java b/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java index 53f207c..c87c25b 100644 --- a/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java +++ b/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java @@ -3,6 +3,7 @@ package cuchaz.enigma.bytecode; import javassist.CtBehavior; import javassist.CtClass; import javassist.bytecode.ByteArray; +import javassist.bytecode.CodeAttribute; import javassist.bytecode.ConstPool; import javassist.bytecode.LocalVariableAttribute; @@ -13,7 +14,11 @@ public class LocalVariableRenamer { for (CtBehavior behavior : c.getDeclaredBehaviors()) { // if there's a local variable table, just rename everything to v1, v2, v3, ... for now - LocalVariableAttribute table = (LocalVariableAttribute)behavior.getMethodInfo().getCodeAttribute().getAttribute(LocalVariableAttribute.tag); + CodeAttribute codeAttribute = behavior.getMethodInfo().getCodeAttribute(); + if (codeAttribute == null) { + continue; + } + LocalVariableAttribute table = (LocalVariableAttribute)codeAttribute.getAttribute(LocalVariableAttribute.tag); if (table == null) { continue; } -- cgit v1.2.3