Skip to content

Commit

Permalink
refactor to avoid double null check && double toString method call
Browse files Browse the repository at this point in the history
  • Loading branch information
MF-KYJKVZUPVATJ authored and MF-KYJKVZUPVATJ committed Jan 23, 2024
1 parent 5583c77 commit 4bde3c8
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,13 @@ private Map<String, Value> runJavaAction(Map<String, SerializableSessionObject>
}

final Serializable exception = returnMap.get(EXCEPTION);
// some java actions contain the exception key without having an actual exception
// this is because some actions have the output field named as "errorMessage", others "exception"
if (exception != null && StringUtils.isNotEmpty(exception.toString())) {
logException(exception.toString());
if (exception != null) {
// some java actions contain the exception key without having an actual exception
// this is because some actions have the output field named as "errorMessage", others "exception"
String exceptionMessage = exception.toString();
if (!exceptionMessage.isEmpty()) {
logException(exceptionMessage);
}
}

return handleSensitiveValues(returnMap, currentContext);
Expand Down

0 comments on commit 4bde3c8

Please sign in to comment.