Skip to content

[ML] Prevent NPE parsing the stop datafeed request. #33347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,13 @@ public static Request parseRequest(String datafeedId, XContentParser parser) {
}

private String datafeedId;
private String[] resolvedStartedDatafeedIds;
private String[] resolvedStartedDatafeedIds = new String[] {};
private TimeValue stopTimeout = DEFAULT_TIMEOUT;
private boolean force = false;
private boolean allowNoDatafeeds = true;

public Request(String datafeedId) {
this.datafeedId = ExceptionsHelper.requireNonNull(datafeedId, DatafeedConfig.ID.getPreferredName());
this.resolvedStartedDatafeedIds = new String[] { datafeedId };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be set to datafeedId and is overwritten in TransportStopDatafeedAction

}

public Request() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ protected Request createTestInstance() {
if (randomBoolean()) {
request.setAllowNoDatafeeds(randomBoolean());
}
if (randomBoolean()) {
request.setResolvedStartedDatafeedIds(generateRandomStringArray(4, 8, false));
}
return request;
}

Expand Down