mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-26 03:22:13 +02:00
Fix potential NPE in MethodAnalyzer
This commit is contained in:
parent
1b0a917a6a
commit
5388ed57ba
@ -1645,11 +1645,14 @@ public class MethodAnalyzer {
|
|||||||
|
|
||||||
// methodClass is now the first accessible class found. Now. we need to make sure that the method is
|
// methodClass is now the first accessible class found. Now. we need to make sure that the method is
|
||||||
// actually valid for this class
|
// actually valid for this class
|
||||||
resolvedMethod = classPath.getClass(methodClass.getType()).getMethodByVtableIndex(methodIndex);
|
MethodReference newResolvedMethod =
|
||||||
if (resolvedMethod == null) {
|
classPath.getClass(methodClass.getType()).getMethodByVtableIndex(methodIndex);
|
||||||
|
if (newResolvedMethod == null) {
|
||||||
|
// TODO: fix NPE here
|
||||||
throw new ExceptionWithContext("Couldn't find accessible class while resolving method %s",
|
throw new ExceptionWithContext("Couldn't find accessible class while resolving method %s",
|
||||||
ReferenceUtil.getMethodDescriptor(resolvedMethod, true));
|
ReferenceUtil.getMethodDescriptor(resolvedMethod, true));
|
||||||
}
|
}
|
||||||
|
resolvedMethod = newResolvedMethod;
|
||||||
resolvedMethod = new ImmutableMethodReference(methodClass.getType(), resolvedMethod.getName(),
|
resolvedMethod = new ImmutableMethodReference(methodClass.getType(), resolvedMethod.getName(),
|
||||||
resolvedMethod.getParameterTypes(), resolvedMethod.getReturnType());
|
resolvedMethod.getParameterTypes(), resolvedMethod.getReturnType());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user