Quellcode durchsuchen

fix: page null exception, close #821

GyDi vor 1 Jahr
Ursprung
Commit
fb08af96bd
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 1
      src/components/connection/connection-item.tsx
  2. 1 1
      src/pages/connections.tsx

+ 1 - 1
src/components/connection/connection-item.tsx

@@ -58,7 +58,7 @@ export const ConnectionItem = (props: Props) => {
 
             {!!metadata.process && <Tag>{metadata.process}</Tag>}
 
-            {chains.length > 0 && <Tag>{chains[value.chains.length - 1]}</Tag>}
+            {chains?.length > 0 && <Tag>{chains[value.chains.length - 1]}</Tag>}
 
             <Tag>{dayjs(start).fromNow()}</Tag>
 

+ 1 - 1
src/pages/connections.tsx

@@ -69,7 +69,7 @@ const ConnectionsPage = () => {
 
         const connections: typeof oldConn = [];
 
-        const rest = data.connections?.filter((each) => {
+        const rest = (data.connections || []).filter((each) => {
           const index = oldConn.findIndex((o) => o.id === each.id);
 
           if (index >= 0 && index < maxLen) {