Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
xuelianhan007 committed Dec 13, 2024
1 parent 441275c commit 1a52ea3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static String process422(Throwable throwable) {
if (throwable == null) {
return ERROR_422_INVALID_FORMAT.getMsg();
}
return Optional.of(throwable.getCause())
return Optional.ofNullable(throwable.getCause())
.flatMap(cause -> Optional.ofNullable(cause.getMessage()))
.filter(isMissingProperty.or(isInvalidValue))
.orElseGet(ERROR_422_INVALID_FORMAT::getMsg);
Expand Down

0 comments on commit 1a52ea3

Please sign in to comment.