From dbf407a6554b9dee5a11894bf9af5df73c2d7ec6 Mon Sep 17 00:00:00 2001 From: Maxim Degtyarev Date: Fri, 18 Dec 2020 20:17:05 +0100 Subject: [PATCH] Fix NPE inside `ExceptionRangeCFG::toString()` for `finally` exception range PR #1026 GitOrigin-RevId: 18492644f44796505f5a4be9471344c1ce1d0f3a --- .../java/decompiler/code/cfg/ExceptionRangeCFG.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/code/cfg/ExceptionRangeCFG.java b/src/org/jetbrains/java/decompiler/code/cfg/ExceptionRangeCFG.java index ce143aa..395d03d 100644 --- a/src/org/jetbrains/java/decompiler/code/cfg/ExceptionRangeCFG.java +++ b/src/org/jetbrains/java/decompiler/code/cfg/ExceptionRangeCFG.java @@ -1,4 +1,4 @@ -// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.java.decompiler.code.cfg; import org.jetbrains.java.decompiler.main.DecompilerContext; @@ -31,9 +31,16 @@ public class ExceptionRangeCFG { StringBuilder buf = new StringBuilder(); buf.append("exceptionType:"); - for (String exception_type : exceptionTypes) { - buf.append(" ").append(exception_type); + + if (exceptionTypes == null) { + buf.append(" null"); + } + else { + for (String exception_type : exceptionTypes) { + buf.append(" ").append(exception_type); + } } + buf.append(new_line_separator); buf.append("handler: ").append(handler.id).append(new_line_separator);