Skip to content

Commit

Permalink
Protect against DateHistogramGroupSource.field being null
Browse files Browse the repository at this point in the history
  • Loading branch information
przemekwitek committed Aug 16, 2021
1 parent f3401d0 commit a575b77
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.elasticsearch.xpack.transform.persistence.TransformConfigManager;

import java.time.Clock;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;
import java.util.Map;
Expand Down Expand Up @@ -136,7 +137,7 @@ private static Function<Long, Long> createAlignTimestampFunction(TransformConfig
groups.values().stream()
.filter(DateHistogramGroupSource.class::isInstance)
.map(DateHistogramGroupSource.class::cast)
.filter(group -> group.getField().equals(transformConfig.getSyncConfig().getField()))
.filter(group -> Objects.equals(group.getField(), transformConfig.getSyncConfig().getField()))
.findFirst();
if (dateHistogramGroupSource.isEmpty()) {
return identity();
Expand Down

0 comments on commit a575b77

Please sign in to comment.