Skip to content

Commit

Permalink
[SUREFIRE-2169] Potential NPE in WrappedReportEntry when #getElapsed(…
Browse files Browse the repository at this point in the history
…) is called

This closes #643
  • Loading branch information
michael-o committed May 24, 2023
1 parent 3ff4afd commit 56ebd61
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -140,7 +140,7 @@ public String getStackTrace(boolean trimStackTrace) {
}

public String elapsedTimeAsString() {
return formatElapsedTime(getElapsed());
return getElapsed() != null ? formatElapsedTime(getElapsed()) : null;
}

String getReportSourceName() {
Expand Down Expand Up @@ -171,7 +171,7 @@ public String getOutput(boolean trimStackTrace) {
}

public String getElapsedTimeVerbose() {
return "Time elapsed: " + elapsedTimeAsString() + " s";
return "Time elapsed: " + (getElapsed() != null ? elapsedTimeAsString() + " s" : "(unknown)");
}

public String getElapsedTimeSummary() {
Expand Down

0 comments on commit 56ebd61

Please sign in to comment.