[Bug #1257] Prevent saving null TaskSource

The error happens becase of milestones don't have TaskSource.

FEA: ItEr75S04BugFixing
This commit is contained in:
Manuel Rego Casasnovas 2011-11-15 12:01:18 +01:00
parent c6b7704cdf
commit 996783c9a8

View file

@ -56,6 +56,7 @@ import org.libreplan.business.orders.entities.HoursGroup;
import org.libreplan.business.orders.entities.Order;
import org.libreplan.business.orders.entities.OrderElement;
import org.libreplan.business.orders.entities.OrderLineGroup;
import org.libreplan.business.orders.entities.TaskSource;
import org.libreplan.business.planner.daos.IConsolidationDAO;
import org.libreplan.business.planner.daos.IDependencyDAO;
import org.libreplan.business.planner.daos.ISubcontractedTaskDataDAO;
@ -568,7 +569,10 @@ public class SaveCommandBuilder {
}
private void saveTaskSources(TaskElement taskElement) {
taskSourceDAO.save(taskElement.getTaskSource());
TaskSource taskSource = taskElement.getTaskSource();
if (taskSource != null) {
taskSourceDAO.save(taskSource);
}
if (taskElement.isLeaf()) {
return;
}