[ML] If snapshot list is empty, return after signaling failure

Original commit: elastic/x-pack-elasticsearch@a89f88da11
This commit is contained in:
Zachary Tong 2017-04-11 11:19:00 -04:00
parent 71852c7215
commit 6f643ffba5
1 changed files with 1 additions and 0 deletions

View File

@ -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);