Minor java 8ism: optional.ifPresent, not an if statement
@@ -84,7 +84,7 @@ public static Response failure(
if (reason != null) {
JsonObject json = new Json().toJsonElement(reason).getAsJsonObject();
- json.addProperty("screen", screenshot.orElse(null));
+ screenshot.ifPresent(screen -> json.addProperty("screen", screen));
response.setValue(json);
}
return response;
