Skip to content

Commit

Permalink
fix NullPointerException
Browse files Browse the repository at this point in the history
fix "NullPointerException throw by maybeReadTimeOut() that can cause Eureka cluster registration inconsistency"

Netflix#1497
  • Loading branch information
niu-dali committed Apr 21, 2023
1 parent efc1cf6 commit 7e7b9a2
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,13 @@ private static boolean isNetworkConnectException(Throwable e) {
private static boolean maybeReadTimeOut(Throwable e) {
do {
if (IOException.class.isInstance(e)) {
String message = e.getMessage().toLowerCase();
Matcher matcher = READ_TIME_OUT_PATTERN.matcher(message);
if(matcher.find()) {
return true;
}
String message = e.getMessage();
if (message != null) {
Matcher matcher = READ_TIME_OUT_PATTERN.matcher(message.toLowerCase());
if(matcher.find()) {
return true;
}
}
}
e = e.getCause();
} while (e != null);
Expand Down

0 comments on commit 7e7b9a2

Please sign in to comment.