Bug #1549: Avoid exception avoiding checking lines resource if there are no lines
In ExpenseSheet.checkConstraintPersonalExpenseSheetMustHaveTheSameResourceInAllLines we check that the resource is the same in all the lines. However, if there are no lines an exception arises. FEA: ItEr77S04BugFixing
This commit is contained in:
parent
283cab8d23
commit
47600797d8
1 changed files with 4 additions and 0 deletions
|
|
@ -244,6 +244,10 @@ public class ExpenseSheet extends IntegrationEntity implements IHumanIdentifiabl
|
|||
return true;
|
||||
}
|
||||
|
||||
if (expenseSheetLines.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Resource resource = expenseSheetLines.iterator().next().getResource();
|
||||
|
||||
for (ExpenseSheetLine line : expenseSheetLines) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue