Skip to content

Commit 708e51f

Browse files
committed
fix: Take care about NPE and break after found TextStatusComposer2 method
1 parent 13696a7 commit 708e51f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

app/src/main/java/com/wmods/wppenhacer/xposed/core/devkit/Unobfuscator.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,9 +1559,14 @@ public synchronized static Method loadTextStatusComposer2(ClassLoader classLoade
15591559
));
15601560
if (result.isEmpty()) {
15611561
var tscClazzData = dexkit.getClassData("com.whatsapp.statuscomposer.composer.TextStatusComposerFragment");
1562-
for (var method : tscClazzData.getMethods()) {
1563-
var tdMethod = method.getInvokes().stream().filter(m -> m.isMethod() && m.getParamCount() == 1 && m.getParamTypes().get(0).equals(dexkit.getClassData(TextDataClass))).findFirst();
1564-
tdMethod.ifPresent(methodData -> result.add(methodData.getDeclaredClass()));
1562+
if (tscClazzData != null) {
1563+
for (var method : tscClazzData.getMethods()) {
1564+
var tdMethod = method.getInvokes().stream().filter(m -> m.isMethod() && m.getParamCount() == 1 && m.getParamTypes().get(0).equals(dexkit.getClassData(TextDataClass))).findFirst();
1565+
if (tdMethod.isPresent()) {
1566+
result.add(tdMethod.get().getDeclaredClass());
1567+
break;
1568+
}
1569+
}
15651570
}
15661571

15671572
if (result.isEmpty()) {

0 commit comments

Comments
 (0)