From e54996bd5e143c62d8fdad2af85d4a16e1a7fae9 Mon Sep 17 00:00:00 2001 From: cv <34649812+cpvalente@users.noreply.github.com> Date: Thu, 6 Apr 2023 11:58:47 +0200 Subject: [PATCH] refactor: prevent iterating on undefined --- apps/client/src/features/info/InfoNif.tsx | 2 +- apps/client/src/features/rundown/Rundown.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/client/src/features/info/InfoNif.tsx b/apps/client/src/features/info/InfoNif.tsx index 3b33aba7c..19a0567df 100644 --- a/apps/client/src/features/info/InfoNif.tsx +++ b/apps/client/src/features/info/InfoNif.tsx @@ -15,7 +15,7 @@ export default function InfoNif() { return (
- {data?.networkInterfaces.map((nif) => ( + {data?.networkInterfaces?.map((nif) => ( handleClick(nif.address)} className={style.interface}> {`${nif.name} - ${nif.address}`} diff --git a/apps/client/src/features/rundown/Rundown.tsx b/apps/client/src/features/rundown/Rundown.tsx index 386e1051d..5fc711907 100644 --- a/apps/client/src/features/rundown/Rundown.tsx +++ b/apps/client/src/features/rundown/Rundown.tsx @@ -194,7 +194,7 @@ export default function Rundown(props: RundownProps) { } }; - if (!entries.length) { + if (statefulEntries?.length < 1) { return insertAtCursor(SupportedEvent.Event, -1)} />; }