File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -127,8 +127,16 @@ export class MacOsSplitTunnelingAppListRetriever implements ISplitTunnelingAppLi
127
127
* Returns contents of directory with results as absolute paths.
128
128
*/
129
129
private async readDirectory ( applicationDir : string ) {
130
- const basenames = await fs . readdir ( applicationDir ) ;
131
- return basenames . map ( ( basename ) => path . join ( applicationDir , basename ) ) ;
130
+ try {
131
+ const basenames = await fs . readdir ( applicationDir ) ;
132
+ return basenames . map ( ( basename ) => path . join ( applicationDir , basename ) ) ;
133
+ } catch ( err ) {
134
+ const e = err as NodeJS . ErrnoException ;
135
+ if ( e . code === 'ENOENT' || e . code === 'ENOTDIR' ) {
136
+ return [ ] ;
137
+ }
138
+ throw err ;
139
+ }
132
140
}
133
141
134
142
private async readApplicationBundlePlist ( applicationBundlePath : string ) : Promise < Plist > {
You can’t perform that action at this time.
0 commit comments