Skip to content

Commit

Permalink
fix: Avoid searching if workspace folder not present
Browse files Browse the repository at this point in the history
  • Loading branch information
svsool committed Jan 29, 2022
1 parent 03c0960 commit 4f39b0d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/workspace/cache/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const utils = () => require('../../utils');
export const cacheRefs = async () => {
const { search, getWorkspaceFolder } = utils();

const fsPaths = await search('\\[\\[([^\\[\\]]+?)\\]\\]', getWorkspaceFolder()!);
const workspaceFolder = getWorkspaceFolder();

const fsPaths = workspaceFolder ? await search('\\[\\[([^\\[\\]]+?)\\]\\]', workspaceFolder) : [];

const searchUris = fsPaths.length
? workspaceCache.markdownUris.filter(({ fsPath }) => fsPaths.includes(fsPath))
Expand Down

0 comments on commit 4f39b0d

Please # to comment.