Fix NPE if provided allocation is null
FEA: ItEr74S04BugFixing
This commit is contained in:
parent
d7e7634028
commit
f4fc8f53d3
1 changed files with 8 additions and 4 deletions
|
|
@ -671,13 +671,17 @@ public abstract class AllocationRow {
|
|||
}
|
||||
|
||||
private void loadResourcesPerDayFrom(ResourceAllocation<?> allocation) {
|
||||
setResourcesPerDayEditedValue(extractEditedValueFrom(allocation));
|
||||
}
|
||||
|
||||
private ResourcesPerDay extractEditedValueFrom(
|
||||
ResourceAllocation<?> allocation) {
|
||||
if (allocation == null) {
|
||||
setResourcesPerDayEditedValue(ResourcesPerDay.amount(0));
|
||||
return ResourcesPerDay.amount(0);
|
||||
}
|
||||
boolean useIntention = currentCalculatedValue != CalculatedValue.RESOURCES_PER_DAY;
|
||||
setResourcesPerDayEditedValue(useIntention ? allocation
|
||||
.getIntendedResourcesPerDay() : allocation
|
||||
.getNonConsolidatedResourcePerDay());
|
||||
return useIntention ? allocation.getIntendedResourcesPerDay()
|
||||
: allocation.getNonConsolidatedResourcePerDay();
|
||||
}
|
||||
|
||||
public abstract ResourceEnum getType();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue