diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java index 75e361720fe..7bc3271523b 100755 --- a/server/src/com/cloud/api/ApiDispatcher.java +++ b/server/src/com/cloud/api/ApiDispatcher.java @@ -430,10 +430,9 @@ public class ApiDispatcher { switch (listType) { case LONG: case UUID: - List listParam = new ArrayList(); - listParam = (List) field.get(cmd); + List listParam = (List) field.get(cmd); for (Long entityId : listParam) { - Object entityObj = s_instance._entityMgr.findById(entity, (Long) field.get(cmd)); + Object entityObj = s_instance._entityMgr.findById(entity, entityId); entitiesToAccess.add(entityObj); } break;