fix: add missing null check in codegen for classes generated by jadx

This commit is contained in:
Skylot
2024-10-14 19:08:07 +01:00
parent b872ffd1b9
commit 8f3cc3e8c1
5 changed files with 57 additions and 16 deletions
@@ -140,7 +140,9 @@ public class CodeGenUtils {
String inputFileName = cls.getClsData().getInputFileName();
if (inputFileName != null) {
ClassNode declCls = cls.getDeclaringClass();
if (declCls != null && inputFileName.equals(declCls.getClsData().getInputFileName())) {
if (declCls != null
&& declCls.getClsData() != null
&& inputFileName.equals(declCls.getClsData().getInputFileName())) {
// don't add same comment for inner classes
return;
}
@@ -864,7 +864,12 @@ public class ClassNode extends NotificationAttrNode
}
}
public IClassData getClsData() {
/**
* Low level class data access.
*
* @return null for classes generated by jadx
*/
public @Nullable IClassData getClsData() {
return clsData;
}