Skip to content

Commit d9437fa

Browse files
Wrap ClassReferenceInitializer in null check
CallableReferenceInitializer might throw an NPE in ProGuard 8.0.0. It will be fixed in 8.0.1
1 parent 31a130e commit d9437fa

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/main/java/proguard/tools/KotlinMetadataPrinter.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,19 @@ public void write(int i) { }
292292

293293
// Initialize the other references from the program classes.
294294
programClassPool.classesAccept(
295-
new ClassReferenceInitializer(programClassPool,
296-
new ClassPool(),
297-
nullWarningPrinter,
298-
nullWarningPrinter,
299-
nullWarningPrinter,
300-
null));
295+
clazz -> {
296+
try {
297+
clazz.accept(
298+
new ClassReferenceInitializer(programClassPool,
299+
new ClassPool(),
300+
nullWarningPrinter,
301+
nullWarningPrinter,
302+
nullWarningPrinter,
303+
null));
304+
} catch (Exception ignored) {
305+
// TODO: callable reference initialization may cause NPE, will be fixed in ProGuardCORE 8.0.1
306+
}
307+
});
301308
}
302309

303310
private static String metadataKindToString(int k)

0 commit comments

Comments
 (0)