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
|
output
|
||||||
.append("\n")
|
.append("\n")
|
||||||
.append(stacktraceAsStringRecursive(throwable.getCause(), indent, includeHeader));
|
.append(stacktraceAsStringRecursive(throwable.getCause(), indent, includeHeader));
|
||||||
if (throwable instanceof ClassNotFoundException exception)
|
if (throwable instanceof ClassNotFoundException exception && exception.getException() != null)
|
||||||
output
|
output
|
||||||
.append("\n")
|
.append("\n")
|
||||||
.append(stacktraceAsStringRecursive(exception.getException(), indent, includeHeader));
|
.append(stacktraceAsStringRecursive(exception.getException(), indent, includeHeader));
|
||||||
if (throwable instanceof ExceptionInInitializerError exception)
|
if (throwable instanceof ExceptionInInitializerError exception && exception.getException() != null)
|
||||||
output
|
output
|
||||||
.append("\n")
|
.append("\n")
|
||||||
.append(stacktraceAsStringRecursive(exception.getException(), indent, includeHeader));
|
.append(stacktraceAsStringRecursive(exception.getException(), indent, includeHeader));
|
||||||
if (throwable instanceof InvocationTargetException exception)
|
if (throwable instanceof InvocationTargetException exception && exception.getTargetException() != null)
|
||||||
output
|
output
|
||||||
.append("\n")
|
.append("\n")
|
||||||
.append(stacktraceAsStringRecursive(exception.getTargetException(), indent, includeHeader));
|
.append(stacktraceAsStringRecursive(exception.getTargetException(), indent, includeHeader));
|
||||||
|
|
Loading…
Reference in a new issue