Fix issue deleting a project from the webservice

A NPE was appearing because of the parent of a project is null.

FEA: ItEr77S13AllowDeleteOrderElements
This commit is contained in:
Manuel Rego Casasnovas 2012-11-29 12:38:06 +01:00
parent e7c18be09e
commit 775f643e80

View file

@ -183,7 +183,8 @@ public class OrderElementServiceREST extends
}
OrderLineGroup parent = orderElement.getParent();
if (!parent.isOrder() && parent.getChildren().size() == 1) {
if (parent != null && !parent.isOrder()
&& parent.getChildren().size() == 1) {
if (orderElementDAO.isAlreadyInUse(parent)) {
return "You cannot remove the order element '"
+ orderElement.getName()