refactor: prevent iterating on undefined

This commit is contained in:
cv
2023-04-06 11:58:47 +02:00
parent 41753fc202
commit e54996bd5e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ export default function InfoNif() {
return (
<div className={style.interfaceList}>
{data?.networkInterfaces.map((nif) => (
{data?.networkInterfaces?.map((nif) => (
<span key={nif.address} onClick={() => handleClick(nif.address)} className={style.interface}>
{`${nif.name} - ${nif.address}`}
<IoArrowUp className={style.linkIcon} />
+1 -1
View File
@@ -194,7 +194,7 @@ export default function Rundown(props: RundownProps) {
}
};
if (!entries.length) {
if (statefulEntries?.length < 1) {
return <RundownEmpty handleAddNew={() => insertAtCursor(SupportedEvent.Event, -1)} />;
}