diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationModel.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationModel.java index e55163a12..e03d455c9 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationModel.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationModel.java @@ -317,7 +317,9 @@ public class ResourceAllocationModel implements IResourceAllocationModel { private void reattachResource(Resource resource) { resourceDAO.reattach(resource); reattachCriterionSatisfactions(resource.getCriterionSatisfactions()); - calendarDAO.reattachUnmodifiedEntity(resource.getCalendar()); + if (resource.getCalendar() != null) { + calendarDAO.reattachUnmodifiedEntity(resource.getCalendar()); + } for (DayAssignment dayAssignment : resource.getAssignments()) { Hibernate.initialize(dayAssignment); }