Skip to content

Commit 1992252

Browse files
josecarneiroJosé Carneiro
andauthored
Narrow down check for tax object (#254)
Co-authored-by: José Carneiro <[email protected]>
1 parent 4c2a32a commit 1992252

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/variables/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,13 @@ export const processTaxRecurrences = (
394394

395395
export const getTaxRate = (
396396
source: any,
397-
i18n: any,
397+
i18n: I18n,
398398
index = 0,
399399
emptyTaxPlaceholder = i18n.t('table_order.no_tax', '(no tax)'),
400400
) => {
401401
const tax = source.taxes?.[index]?.tax;
402402

403-
if (tax !== undefined) {
403+
if (typeof tax === 'object' && tax !== null) {
404404
const rate = tax.rate;
405405
const description = tax.description;
406406

0 commit comments

Comments
 (0)