Make ClassForNameTransformer compatible with SimpleRemapper

SimpleRemapper returns null if a class should not be renamed.
bzip2
Graham 5 years ago
parent a056217cc2
commit 3b35a39084
  1. 5
      deob/src/main/java/dev/openrs2/deob/transform/ClassForNameTransformer.java

@ -36,7 +36,10 @@ public final class ClassForNameTransformer extends Transformer {
public void transformCode(ClassNode clazz, MethodNode method) { public void transformCode(ClassNode clazz, MethodNode method) {
INVOKE_MATCHER.match(method).filter(ClassForNameTransformer::isClassForName).forEach(match -> { INVOKE_MATCHER.match(method).filter(ClassForNameTransformer::isClassForName).forEach(match -> {
var ldc = (LdcInsnNode) match.get(0); var ldc = (LdcInsnNode) match.get(0);
ldc.cst = remapper.map((String) ldc.cst); var name = remapper.map((String) ldc.cst);
if (name != null) {
ldc.cst = name;
}
}); });
} }
} }

Loading…
Cancel
Save