File tree Expand file tree Collapse file tree
workbench/services/authentication/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,6 +193,11 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
193193 processInfo . load = parseFloat ( cpuUsage [ i ] ) ;
194194 }
195195
196+ if ( ! rootItem ) {
197+ reject ( new Error ( `Root process ${ rootPid } not found` ) ) ;
198+ return ;
199+ }
200+
196201 resolve ( rootItem ) ;
197202 }
198203 } ) ;
@@ -228,7 +233,11 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
228233 if ( process . platform === 'linux' ) {
229234 calculateLinuxCpuUsage ( ) ;
230235 } else {
231- resolve ( rootItem ) ;
236+ if ( ! rootItem ) {
237+ reject ( new Error ( `Root process ${ rootPid } not found` ) ) ;
238+ } else {
239+ resolve ( rootItem ) ;
240+ }
232241 }
233242 }
234243 } ) ;
Original file line number Diff line number Diff line change @@ -444,7 +444,12 @@ export class AuthenticationService extends Disposable implements IAuthentication
444444 const didRegister : Promise < MainThreadAuthenticationProvider > = new Promise ( ( resolve , _ ) => {
445445 this . onDidRegisterAuthenticationProvider ( e => {
446446 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+ }
448453 }
449454 } ) ;
450455 } ) ;
You can’t perform that action at this time.
0 commit comments