Skip to content

Commit

Permalink
Wrap ClassReferenceInitializer in null check
Browse files Browse the repository at this point in the history
CallableReferenceInitializer might throw an NPE in ProGuard 8.0.0. It
will be fixed in 8.0.1
  • Loading branch information
James Hamilton committed Aug 11, 2021
1 parent 31a130e commit d9437fa
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/main/java/proguard/tools/KotlinMetadataPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,19 @@ public void write(int i) { }

// Initialize the other references from the program classes.
programClassPool.classesAccept(
new ClassReferenceInitializer(programClassPool,
new ClassPool(),
nullWarningPrinter,
nullWarningPrinter,
nullWarningPrinter,
null));
clazz -> {
try {
clazz.accept(
new ClassReferenceInitializer(programClassPool,
new ClassPool(),
nullWarningPrinter,
nullWarningPrinter,
nullWarningPrinter,
null));
} catch (Exception ignored) {
// TODO: callable reference initialization may cause NPE, will be fixed in ProGuardCORE 8.0.1
}
});
}

private static String metadataKindToString(int k)
Expand Down

0 comments on commit d9437fa

Please sign in to comment.