Skip to content

Commit 2307248

Browse files
#41: Null pointer fix in LexUtils.getRootException(Throwable ex)
1 parent 0db185d commit 2307248

File tree

1 file changed

+4
-1
lines changed
  • spring-lemon-exceptions/src/main/java/com/naturalprogrammer/spring/lemon/exceptions/util

1 file changed

+4
-1
lines changed

spring-lemon-exceptions/src/main/java/com/naturalprogrammer/spring/lemon/exceptions/util/LexUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ public static String getExceptionId(Throwable ex) {
158158

159159

160160
private static Throwable getRootException(Throwable ex) {
161-
161+
162+
if (ex == null)
163+
return null;
164+
162165
while(ex.getCause() != null)
163166
ex = ex.getCause();
164167

0 commit comments

Comments
 (0)