Fix NPE in my tasks area when SumCharegedEffort is still null
FEA: ItEr76S28UserDashboard
This commit is contained in:
parent
6f7ec19908
commit
ec4745a100
1 changed files with 10 additions and 4 deletions
|
|
@ -27,7 +27,9 @@ import java.util.List;
|
|||
import org.libreplan.business.advance.entities.AdvanceMeasurement;
|
||||
import org.libreplan.business.advance.entities.DirectAdvanceAssignment;
|
||||
import org.libreplan.business.orders.entities.OrderElement;
|
||||
import org.libreplan.business.orders.entities.SumChargedEffort;
|
||||
import org.libreplan.business.planner.entities.Task;
|
||||
import org.libreplan.business.workingday.EffortDuration;
|
||||
import org.libreplan.web.common.Util;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.util.GenericForwardComposer;
|
||||
|
|
@ -62,10 +64,14 @@ public class MyTasksAreaController extends GenericForwardComposer {
|
|||
|
||||
Util.appendLabel(row, getProgress(orderElement));
|
||||
|
||||
Util.appendLabel(
|
||||
row,
|
||||
_("{0} h", orderElement.getSumChargedEffort()
|
||||
.getTotalChargedEffort().toFormattedString()));
|
||||
Util.appendLabel(row, getEffort(orderElement));
|
||||
}
|
||||
|
||||
private String getEffort(OrderElement orderElement) {
|
||||
SumChargedEffort sumChargedEffort = orderElement.getSumChargedEffort();
|
||||
EffortDuration effort = sumChargedEffort != null ? sumChargedEffort
|
||||
.getTotalChargedEffort() : EffortDuration.zero();
|
||||
return _("{0} h", effort.toFormattedString());
|
||||
}
|
||||
|
||||
private String getProgress(OrderElement orderElement) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue