aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx b/packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx
index 7aa2703a4..c9226ad69 100644
--- a/packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx
+++ b/packages/merchant-backoffice-ui/src/components/form/InputDuration.tsx
@@ -58,6 +58,9 @@ export function InputDuration<T>({
} else if (value.d_ms === "forever") {
strValue = i18n.str`forever`;
} else {
+ if (value.d_ms === undefined) {
+ throw Error(`assertion error: duration should have a d_ms but got '${JSON.stringify(value)}'`)
+ }
strValue = formatDuration(
intervalToDuration({ start: 0, end: value.d_ms }),
{