Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Macfarlane committed Sep 9, 2020
1 parent 80b1a77 commit cceaf14
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/vs/base/node/ps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
processInfo.load = parseFloat(cpuUsage[i]);
}

if (!rootItem) {
reject(new Error(`Root process ${rootPid} not found`));
return;
}

resolve(rootItem);
}
});
Expand Down Expand Up @@ -228,7 +233,11 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
if (process.platform === 'linux') {
calculateLinuxCpuUsage();
} else {
resolve(rootItem);
if (!rootItem) {
reject(new Error(`Root process ${rootPid} not found`));
} else {
resolve(rootItem);
}
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,12 @@ export class AuthenticationService extends Disposable implements IAuthentication
const didRegister: Promise<MainThreadAuthenticationProvider> = new Promise((resolve, _) => {
this.onDidRegisterAuthenticationProvider(e => {
if (e.id === providerId) {
resolve(this._authenticationProviders.get(providerId));
provider = this._authenticationProviders.get(providerId);
if (provider) {
resolve(provider);
} else {
throw new Error(`No authentication provider '${providerId}' is currently registered.`);
}
}
});
});
Expand Down

0 comments on commit cceaf14

Please sign in to comment.