Skip to content

Commit

Permalink
Merge branch 'macos-ignore-non-existent-dirs-split-tunneling'
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed May 29, 2024
2 parents b70eddc + 0cb3d34 commit ba741db
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions gui/src/main/macos-split-tunneling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,16 @@ export class MacOsSplitTunnelingAppListRetriever implements ISplitTunnelingAppLi
* Returns contents of directory with results as absolute paths.
*/
private async readDirectory(applicationDir: string) {
const basenames = await fs.readdir(applicationDir);
return basenames.map((basename) => path.join(applicationDir, basename));
try {
const basenames = await fs.readdir(applicationDir);
return basenames.map((basename) => path.join(applicationDir, basename));
} catch (err) {
const e = err as NodeJS.ErrnoException;
if (e.code !== 'ENOENT' && e.code !== 'ENOTDIR') {
log.error(`Failed to read directory contents: ${applicationDir}`, err);
}
return [];
}
}

private async readApplicationBundlePlist(applicationBundlePath: string): Promise<Plist> {
Expand Down

0 comments on commit ba741db

Please sign in to comment.