Skip to content

Commit f334203

Browse files
authored
do null check (#4894)
1 parent d61943b commit f334203

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/app/src/app/pages/Dashboard/Content/routes/Repositories/useFilteredItems.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ export const useFilteredItems = (params: Params) => {
2020
},
2121
} = useOvermind();
2222
const [items, setItems] = useState<Array<DashboardGridItem>>([]);
23-
const sandboxesForPath =
24-
sandboxes.REPOS && param
25-
? getFilteredSandboxes(sandboxes.REPOS[param].sandboxes || [])
26-
: [];
23+
const sandboxesExist = sandboxes.REPOS && param && sandboxes.REPOS[param];
24+
const sandboxesForPath = sandboxesExist
25+
? getFilteredSandboxes(sandboxes.REPOS[param].sandboxes || [])
26+
: [];
2727

2828
const repos = (sandboxes.REPOS && Object.values(sandboxes.REPOS)) || [];
2929

0 commit comments

Comments
 (0)