diff --git a/api/src/com/cloud/api/commands/AddHostCmd.java b/api/src/com/cloud/api/commands/AddHostCmd.java index a71f672288f..f931fe61f77 100755 --- a/api/src/com/cloud/api/commands/AddHostCmd.java +++ b/api/src/com/cloud/api/commands/AddHostCmd.java @@ -142,7 +142,7 @@ public class AddHostCmd extends BaseCmd { List result = _resourceService.discoverHosts(this); ListResponse response = new ListResponse(); List hostResponses = new ArrayList(); - if (result != null) { + if (result != null && result.size() > 0) { for (Host host : result) { HostResponse hostResponse = _responseGenerator.createHostResponse(host); hostResponses.add(hostResponse);