fix: resolve NPE due to not yet processed class (#595)

This commit is contained in:
Skylot
2019-04-21 22:34:27 +03:00
parent 84ef6d0049
commit f1539d2e37
@@ -227,10 +227,6 @@ public class ModVisitor extends AbstractVisitor {
if (callMthNode == null) {
return;
}
Map<InsnArg, FieldNode> argsMap = getArgsToFieldsMapping(callMthNode, co);
if (argsMap.isEmpty() && !callMthNode.getArguments(true).isEmpty()) {
return;
}
ClassNode classNode = callMthNode.getParentClass();
if (!classNode.contains(AFlag.ANONYMOUS_CLASS)) {
@@ -242,6 +238,10 @@ public class ModVisitor extends AbstractVisitor {
if (!mth.getParentClass().getInnerClasses().contains(classNode)) {
return;
}
Map<InsnArg, FieldNode> argsMap = getArgsToFieldsMapping(callMthNode, co);
if (argsMap.isEmpty() && !callMthNode.getArguments(true).isEmpty()) {
return;
}
for (Map.Entry<InsnArg, FieldNode> entry : argsMap.entrySet()) {
FieldNode field = entry.getValue();