From e469b4a9ee2d3d586aff3b1fd56ae44ff99c4652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Aragunde=20P=C3=A9rez?= Date: Wed, 2 Dec 2009 20:58:42 +0100 Subject: [PATCH] ItEr37S12CUAdministracionCategoriaCosteItEr36S14: fixed the exception thrown when the combobox for TypeOfWorkHours is null --- .../CostCategoryCRUDController.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/costcategories/CostCategoryCRUDController.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/costcategories/CostCategoryCRUDController.java index 7c61620df..16b59fa64 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/costcategories/CostCategoryCRUDController.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/costcategories/CostCategoryCRUDController.java @@ -227,14 +227,16 @@ public class CostCategoryCRUDController extends GenericForwardComposer public void onEvent(Event event) throws Exception { final Comboitem comboitem = autocomplete.getSelectedItem(); - // Update hourCost - HourCost hourCost = (HourCost) row.getValue(); - hourCost.setType((TypeOfWorkHours) comboitem.getValue()); - row.setValue(hourCost); + if(comboitem != null) { + // Update hourCost + HourCost hourCost = (HourCost) row.getValue(); + hourCost.setType((TypeOfWorkHours) comboitem.getValue()); + row.setValue(hourCost); - // Update the hourPrice in the hourCost - hourCost.setPriceCost(((TypeOfWorkHours) comboitem.getValue()).getDefaultPrice()); - Util.reloadBindings(listHourCosts); + // Update the hourPrice in the hourCost + hourCost.setPriceCost(((TypeOfWorkHours) comboitem.getValue()).getDefaultPrice()); + Util.reloadBindings(listHourCosts); + } } }); row.appendChild(autocomplete);