Allon Mureinik has posted comments on this change.

Change subject: restapi: Fix NPE in request for CDROMs of wrong VM
......................................................................


Patch Set 1: Code-Review+1

(1 comment)

http://gerrit.ovirt.org/#/c/33977/1/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendReadOnlyDevicesResource.java
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendReadOnlyDevicesResource.java:

Line 45:         // when requesting the CDROMs of a VM this query will actually 
load a collection contain the VM, not the CDROMs.
Line 46:         // The result will be null if there is no such VM (if the user 
provided an incorrect id, or if the VM has been
Line 47:         // removed) and in that case we need to respond with the 404 
error code.
Line 48:         List<Q> collection = getBackendCollection(queryType, 
queryParams);
Line 49:         if (collection == null || collection.isEmpty()) {
Consider using CollectionUtils.isEmpty
Line 50:             throw new 
WebApplicationException(Response.Status.NOT_FOUND);
Line 51:         }
Line 52:         return mapCollection(collection);
Line 53:     }


-- 
To view, visit http://gerrit.ovirt.org/33977
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I55d4742649d8d260ae4d7c924c1a9b91efbcea6b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to