From 8c8aad4c21fde2cd37e25ccd4c723a308b79439b Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Tue, 20 Dec 2022 10:16:39 -0300
Subject: fix #7524: do not break if the account is in an invalid state

---
 packages/demobank-ui/src/components/Transactions/views.tsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'packages/demobank-ui/src/components/Transactions/views.tsx')

diff --git a/packages/demobank-ui/src/components/Transactions/views.tsx b/packages/demobank-ui/src/components/Transactions/views.tsx
index b3683b743..1822f9d94 100644
--- a/packages/demobank-ui/src/components/Transactions/views.tsx
+++ b/packages/demobank-ui/src/components/Transactions/views.tsx
@@ -54,7 +54,13 @@ export function ReadyView({ transactions }: State.Ready): VNode {
                 </td>
                 <td>
                   {item.negative ? "-" : ""}
-                  {Amounts.stringifyValue(item.amount)} {item.amount.currency}
+                  {item.amount ? (
+                    `${Amounts.stringifyValue(item.amount)} ${
+                      item.amount.currency
+                    }`
+                  ) : (
+                    <span style={{ color: "grey" }}>&lt;invalid value&gt;</span>
+                  )}
                 </td>
                 <td>{item.counterpart}</td>
                 <td>{item.subject}</td>
-- 
cgit v1.2.3

