Skip to content

Commit 0020080

Browse files
committed
Minor java 8ism: optional.ifPresent, not an if statement
1 parent 2770e3a commit 0020080

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/server/src/org/openqa/selenium/remote/server/rest/Responses.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static Response failure(
8484

8585
if (reason != null) {
8686
JsonObject json = new Json().toJsonElement(reason).getAsJsonObject();
87-
json.addProperty("screen", screenshot.orElse(null));
87+
screenshot.ifPresent(screen -> json.addProperty("screen", screen));
8888
response.setValue(json);
8989
}
9090
return response;

0 commit comments

Comments
 (0)