Skip to content

Commit b8122ab

Browse files
committed
prevent allocating a empty list of item
1 parent 7796336 commit b8122ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Pdf/PdfInvoice.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ public function subTotalDiscountedAmount(): Money
133133
*/
134134
public function totalTaxAmount(): Money
135135
{
136+
if (empty($this->items)) {
137+
return Money::of(0, $this->getCurrency());
138+
}
139+
136140
$totalDiscount = $this->totalDiscountAmount();
137141

138142
/**

0 commit comments

Comments
 (0)