Small fix in HoursWorkedPerWorkerController to avoid NullPointerException

FEA: ItEr75S04BugFixing
This commit is contained in:
Manuel Rego Casasnovas 2011-09-19 11:13:44 +02:00
parent 0db57e81c4
commit b096b7c5bc

View file

@ -116,6 +116,9 @@ public class HoursWorkedPerWorkerController extends NavalplannerReportController
}
private Date getStartingDate() {
if (startingDate.getValue() == null) {
return null;
}
Calendar calendar = Calendar.getInstance();
calendar.setTime(startingDate.getValue());
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
@ -124,6 +127,9 @@ public class HoursWorkedPerWorkerController extends NavalplannerReportController
}
private Date getEndingDate() {
if (endingDate.getValue() == null) {
return null;
}
Calendar calendar = Calendar.getInstance();
calendar.setTime(endingDate.getValue());
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
@ -334,4 +340,4 @@ public class HoursWorkedPerWorkerController extends NavalplannerReportController
private String getParameterLabels() {
return hoursWorkedPerWorkerModel.getSelectedLabel();
}
}
}