[ML] If snapshot list is empty, return after signaling failure
Original commit: elastic/x-pack-elasticsearch@a89f88da11
This commit is contained in:
parent
71852c7215
commit
6f643ffba5
|
@ -164,6 +164,7 @@ public class DeleteModelSnapshotAction extends Action<DeleteModelSnapshotAction.
|
||||||
if (deleteCandidates.isEmpty()) {
|
if (deleteCandidates.isEmpty()) {
|
||||||
listener.onFailure(new ResourceNotFoundException(Messages.getMessage(Messages.REST_NO_SUCH_MODEL_SNAPSHOT,
|
listener.onFailure(new ResourceNotFoundException(Messages.getMessage(Messages.REST_NO_SUCH_MODEL_SNAPSHOT,
|
||||||
request.getSnapshotId(), request.getJobId())));
|
request.getSnapshotId(), request.getJobId())));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
ModelSnapshot deleteCandidate = deleteCandidates.get(0);
|
ModelSnapshot deleteCandidate = deleteCandidates.get(0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue