Fix NPE in stacktraceAsStringRecursive method
This commit is contained in:
parent
92aa012738
commit
571d600b09
1 changed files with 3 additions and 3 deletions
|
@ -193,15 +193,15 @@ public final class Miscellaneous {
|
|||
output
|
||||
.append("\n")
|
||||
.append(stacktraceAsStringRecursive(throwable.getCause(), indent, includeHeader));
|
||||
if (throwable instanceof ClassNotFoundException exception)
|
||||
if (throwable instanceof ClassNotFoundException exception && exception.getException() != null)
|
||||
output
|
||||
.append("\n")
|
||||
.append(stacktraceAsStringRecursive(exception.getException(), indent, includeHeader));
|
||||
if (throwable instanceof ExceptionInInitializerError exception)
|
||||
if (throwable instanceof ExceptionInInitializerError exception && exception.getException() != null)
|
||||
output
|
||||
.append("\n")
|
||||
.append(stacktraceAsStringRecursive(exception.getException(), indent, includeHeader));
|
||||
if (throwable instanceof InvocationTargetException exception)
|
||||
if (throwable instanceof InvocationTargetException exception && exception.getTargetException() != null)
|
||||
output
|
||||
.append("\n")
|
||||
.append(stacktraceAsStringRecursive(exception.getTargetException(), indent, includeHeader));
|
||||
|
|
Loading…
Reference in a new issue