From 6a802a6fc971f37b1cde2db35c97d9984c877626 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 29 Jun 2015 15:13:05 +0300 Subject: [PATCH] java-decompiler: NPE fixed https://github.com/JetBrains/intellij-community/pull/268 --- .../jetbrains/java/decompiler/main/ClassesProcessor.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java index acdf656..5a56641 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java @@ -162,6 +162,12 @@ public class ClassesProcessor { StructClass scl = superNode.classStruct; StructInnerClassesAttribute inner = (StructInnerClassesAttribute)scl.getAttributes().getWithKey("InnerClasses"); + + if (inner == null || inner.getStringEntries().isEmpty()) { + DecompilerContext.getLogger().writeMessage(superClass + " does not contain inner classes!", IFernflowerLogger.Severity.WARN); + continue; + } + for (int i = 0; i < inner.getStringEntries().size(); i++) { String nestedClass = inner.getStringEntries().get(i)[0]; if (!setNestedClasses.contains(nestedClass)) {