Bug #1466: Fix NPE when there are milestones in the planning
FEA: ItEr76S04BugFixing
This commit is contained in:
parent
0e6b5882f6
commit
14ba92e049
1 changed files with 8 additions and 2 deletions
|
|
@ -25,6 +25,7 @@ import java.util.Set;
|
|||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.libreplan.business.labels.entities.Label;
|
||||
import org.libreplan.business.orders.entities.OrderElement;
|
||||
import org.libreplan.business.planner.entities.GenericResourceAllocation;
|
||||
import org.libreplan.business.planner.entities.ResourceAllocation;
|
||||
import org.libreplan.business.planner.entities.SpecificResourceAllocation;
|
||||
|
|
@ -178,11 +179,16 @@ public class TaskElementPredicate implements IPredicate {
|
|||
|
||||
private boolean existLabelInTaskElement(Label filterLabel,
|
||||
TaskElement taskElement) {
|
||||
OrderElement orderElement = taskElement.getOrderElement();
|
||||
if (orderElement == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Set<Label> labels;
|
||||
if (ignoreLabelsInheritance) {
|
||||
labels = taskElement.getOrderElement().getLabels();
|
||||
labels = orderElement.getLabels();
|
||||
} else {
|
||||
labels = taskElement.getOrderElement().getAllLabels();
|
||||
labels = orderElement.getAllLabels();
|
||||
}
|
||||
for (Label label : labels) {
|
||||
if (label.getId().equals(filterLabel.getId())) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue