From 3b35a390849dd9eacbea11d94f293ba5b64b4bac Mon Sep 17 00:00:00 2001 From: Graham Date: Wed, 31 Jul 2019 09:34:30 +0100 Subject: [PATCH] Make ClassForNameTransformer compatible with SimpleRemapper SimpleRemapper returns null if a class should not be renamed. --- .../dev/openrs2/deob/transform/ClassForNameTransformer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deob/src/main/java/dev/openrs2/deob/transform/ClassForNameTransformer.java b/deob/src/main/java/dev/openrs2/deob/transform/ClassForNameTransformer.java index 01ab20d6..9388bdb4 100644 --- a/deob/src/main/java/dev/openrs2/deob/transform/ClassForNameTransformer.java +++ b/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) { INVOKE_MATCHER.match(method).filter(ClassForNameTransformer::isClassForName).forEach(match -> { 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; + } }); } }