diff --git a/core/src/main/java/io/cucumber/core/options/CommandlineOptionsParser.java b/core/src/main/java/io/cucumber/core/options/CommandlineOptionsParser.java index 75ca816d1e..7ebdca4bee 100644 --- a/core/src/main/java/io/cucumber/core/options/CommandlineOptionsParser.java +++ b/core/src/main/java/io/cucumber/core/options/CommandlineOptionsParser.java @@ -45,7 +45,7 @@ public CommandlineOptionsParser(OutputStream outputStream) { } public Optional exitStatus() { - return Optional.of(exitCode); + return Optional.ofNullable(exitCode); } public RuntimeOptionsBuilder parse(String... args) {