未验证 提交 3a298122 编写于 作者: S Skylot

fix(gui): resolve NPE during index (#1254)

上级 67e6b647
......@@ -538,7 +538,11 @@ public final class JadxDecompiler implements Closeable {
}
if (obj instanceof VariableNode) {
VariableNode varNode = (VariableNode) obj;
return new JavaVariable(getJavaClassByNode(varNode.getClassNode().getTopParentClass()), varNode);
JavaClass javaCls = getJavaClassByNode(varNode.getClassNode().getTopParentClass());
if (javaCls == null) {
return null;
}
return new JavaVariable(javaCls, varNode);
}
throw new JadxRuntimeException("Unexpected node type: " + obj);
}
......
......@@ -2,16 +2,17 @@ package jadx.api;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import jadx.core.dex.nodes.VariableNode;
public class JavaVariable implements JavaNode {
JavaClass cls;
VariableNode node;
private final JavaClass cls;
private final VariableNode node;
public JavaVariable(JavaClass cls, VariableNode node) {
this.cls = cls;
this.node = node;
this.cls = Objects.requireNonNull(cls);
this.node = Objects.requireNonNull(node);
}
public VariableNode getVariableNode() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册