Bug #1343: Prevent NullPointerException when showing default filtering dates

on company view.

If the company view is empty, these dates are null but we weren't taking this
case into account.

FEA: ItEr76S04BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2012-02-09 19:33:25 +01:00
parent cbca7447b9
commit 4353465efe

View file

@ -290,10 +290,14 @@ public class CompanyPlanningController implements Composer {
if (listFilters.isEmpty() && startDate == null && finishDate == null) {
IPredicate predicate = model.getDefaultPredicate(includeOrderElements);
//show filter dates calculated by default on screen
filterStartDate.setValue(model.getFilterStartDate().
toDateMidnight().toDate());
filterFinishDate.setValue(model.getFilterFinishDate().
toDateMidnight().toDate());
if(model.getFilterStartDate() != null) {
filterStartDate.setValue(model.getFilterStartDate().
toDateMidnight().toDate());
}
if(model.getFilterFinishDate() != null) {
filterFinishDate.setValue(model.getFilterFinishDate().
toDateMidnight().toDate());
}
return predicate;
}
return new TaskGroupPredicate(listFilters, startDate, finishDate,