diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index a9f8202df..0b7c4802b 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -1264,8 +1264,8 @@ else if (methodWrapper.varproc.getVarFinal(new VarVersionPair(index, 0)) == VarT throwsExceptions = true; buffer.append(" throws "); - boolean useDescriptor = hasDescriptor && !descriptor.exceptionTypes.isEmpty(); - for (int i = 0; i < attr.getThrowsExceptions().size(); i++) { + boolean useDescriptor = descriptor != null && !descriptor.exceptionTypes.isEmpty(); + for (int i = 0; i < (attr == null ? descriptor.exceptionTypes.size() : attr.getThrowsExceptions().size()); i++) { if (i > 0) { buffer.append(", "); } diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java index 43bdb90ce..137971b43 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java @@ -664,7 +664,7 @@ else if (obj instanceof Exprent) { VarType t1 = this.varproc.getVarType(ret.getKey()); VarType t2 = this.varproc.getVarType(ret.getValue()); - if (t1.isSuperset(t2) || t2.isSuperset(t1)) { + if (t1 != null && t2 != null && (t1.isSuperset(t2) || t2.isSuperset(t1))) { // TODO: this only checks for totally disjoint types, there are instances where merging is incorrect with primitives boolean ok = true;