Prevent NPE parsing the stop datafeed request. (#33347)
The issue depends on the request parameters being passed in the request body rather than as query parameters.
This commit is contained in:
parent
54fe7fb5a1
commit
ccb2ad25cc
|
@ -73,14 +73,13 @@ public class StopDatafeedAction extends Action<StopDatafeedAction.Response> {
|
|||
}
|
||||
|
||||
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 };
|
||||
}
|
||||
|
||||
public Request() {
|
||||
|
|
|
@ -24,6 +24,9 @@ public class StopDatafeedActionRequestTests extends AbstractStreamableXContentTe
|
|||
if (randomBoolean()) {
|
||||
request.setAllowNoDatafeeds(randomBoolean());
|
||||
}
|
||||
if (randomBoolean()) {
|
||||
request.setResolvedStartedDatafeedIds(generateRandomStringArray(4, 8, false));
|
||||
}
|
||||
return request;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue