Fix embarrassing NPE in audit trail.
relates elastic/x-pack-elasticsearch#3988
Original commit: elastic/x-pack-elasticsearch@13761c76228fdc69fda1164c18c438ca31478786
@@ -514,7 +514,7 @@ public class LoggingAuditTrail extends AbstractComponent implements AuditTrail,
static Optional<String[]> indices(TransportMessage message) {
if (message instanceof IndicesRequest) {
- return Optional.of(((IndicesRequest) message).indices());
+ return Optional.ofNullable(((IndicesRequest) message).indices());
}
return Optional.empty();
}
