bug 13812: throw error if addition of host fails

reviewed-by: kishan
This commit is contained in:
abhi 2012-02-17 16:31:50 +05:30
parent fc8f6c4c18
commit eda778e24c
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ public class AddHostCmd extends BaseCmd {
List<? extends Host> result = _resourceService.discoverHosts(this);
ListResponse<HostResponse> response = new ListResponse<HostResponse>();
List<HostResponse> hostResponses = new ArrayList<HostResponse>();
if (result != null) {
if (result != null && result.size() > 0) {
for (Host host : result) {
HostResponse hostResponse = _responseGenerator.createHostResponse(host);
hostResponses.add(hostResponse);