Fix NPE with `--watchfs` as startup option.
@@ -256,9 +256,7 @@ public abstract class CommandLineEvent implements BuildEventWithOrderConstraint
private CommandLineSection getExplicitCommandOptions() {
List<ParsedOptionDescription> explicitOptions =
- commandOptions
- .asListOfExplicitOptions()
- .stream()
+ commandOptions.asListOfExplicitOptions().stream()
.filter(
parsedOptionDescription ->
parsedOptionDescription.getPriority().getPriorityCategory()
@@ -350,8 +348,7 @@ public abstract class CommandLineEvent implements BuildEventWithOrderConstraint
.setOptionList(
OptionList.newBuilder()
.addAllOption(
- unfilteredOptions
- .stream()
+ unfilteredOptions.stream()
.filter(
option -> {
String optionName = option.getOptionName();
@@ -393,8 +390,9 @@ public abstract class CommandLineEvent implements BuildEventWithOrderConstraint
}
for (ParsedOptionDescription canonicalOptionDesc :
commandOptions.asListOfCanonicalOptions()) {
- if (canonicalOptionDesc.isHidden()
- || !canonicalOptionDesc.getSource().equals("command line options")) {
+ if (canonicalOptionDesc == null
+ || canonicalOptionDesc.isHidden()
+ || !"command line options".equals(canonicalOptionDesc.getSource())) {
continue;
}
hash = hash * 31 + canonicalOptionDesc.getCanonicalForm().hashCode();
