diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index dde43f8bdf..84dcb5a972 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -494,7 +494,7 @@ export const FileExplorer = (props: FileExplorerProps) => { if (!state.expandPath.includes(path)) { expandPath = [...state.expandPath, path] } else { - expandPath = state.expandPath.filter(key => !key.startsWith(path)) + expandPath = state.expandPath.filter(key => key && (typeof key === 'string') && !key.startsWith(path)) } setState(prevState => {