File tree 2 files changed +16
-2
lines changed
workbench/services/authentication/browser
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,11 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
193
193
processInfo . load = parseFloat ( cpuUsage [ i ] ) ;
194
194
}
195
195
196
+ if ( ! rootItem ) {
197
+ reject ( new Error ( `Root process ${ rootPid } not found` ) ) ;
198
+ return ;
199
+ }
200
+
196
201
resolve ( rootItem ) ;
197
202
}
198
203
} ) ;
@@ -228,7 +233,11 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
228
233
if ( process . platform === 'linux' ) {
229
234
calculateLinuxCpuUsage ( ) ;
230
235
} else {
231
- resolve ( rootItem ) ;
236
+ if ( ! rootItem ) {
237
+ reject ( new Error ( `Root process ${ rootPid } not found` ) ) ;
238
+ } else {
239
+ resolve ( rootItem ) ;
240
+ }
232
241
}
233
242
}
234
243
} ) ;
Original file line number Diff line number Diff line change @@ -444,7 +444,12 @@ export class AuthenticationService extends Disposable implements IAuthentication
444
444
const didRegister : Promise < MainThreadAuthenticationProvider > = new Promise ( ( resolve , _ ) => {
445
445
this . onDidRegisterAuthenticationProvider ( e => {
446
446
if ( e . id === providerId ) {
447
- resolve ( this . _authenticationProviders . get ( providerId ) ) ;
447
+ provider = this . _authenticationProviders . get ( providerId ) ;
448
+ if ( provider ) {
449
+ resolve ( provider ) ;
450
+ } else {
451
+ throw new Error ( `No authentication provider '${ providerId } ' is currently registered.` ) ;
452
+ }
448
453
}
449
454
} ) ;
450
455
} ) ;
You can’t perform that action at this time.
0 commit comments