Skip to content

Commit cceaf14

Browse files
author
Rachel Macfarlane
committed
1 parent 80b1a77 commit cceaf14

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/vs/base/node/ps.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff 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
});

src/vs/workbench/services/authentication/browser/authenticationService.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)