Skip to content

Commit fca4cf0

Browse files
committed
🐛 Fix filter condition
1 parent 914d87d commit fca4cf0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/client/interpreter/locators/services/KnownPathsService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class KnownPathsService extends CacheableLocatorService {
3030
.then(listOfInterpreters => _.flatten(listOfInterpreters))
3131
.then(interpreters => interpreters.filter(item => item.length > 0))
3232
.then(interpreters => Promise.all(interpreters.map(interpreter => this.getInterpreterDetails(interpreter))))
33-
.then(interpreters => interpreters.filter(interpreter => !interpreter).map(interpreter => interpreter!));
33+
.then(interpreters => interpreters.filter(interpreter => !!interpreter).map(interpreter => interpreter!));
3434
}
3535
private async getInterpreterDetails(interpreter: string) {
3636
const details = await this.helper.getInterpreterInformation(interpreter);

src/client/interpreter/locators/services/baseVirtualEnvService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class BaseVirtualEnvService extends CacheableLocatorService {
4040
.then(dirs => Promise.all(dirs.map(lookForInterpretersInDirectory)))
4141
.then(pathsWithInterpreters => _.flatten(pathsWithInterpreters))
4242
.then(interpreters => Promise.all(interpreters.map(interpreter => this.getVirtualEnvDetails(interpreter))))
43-
.then(interpreters => interpreters.filter(interpreter => !interpreter).map(interpreter => interpreter!))
43+
.then(interpreters => interpreters.filter(interpreter => !!interpreter).map(interpreter => interpreter!))
4444
.catch((err) => {
4545
console.error('Python Extension (lookForInterpretersInVenvs):', err);
4646
// Ignore exceptions.
@@ -65,7 +65,7 @@ export class BaseVirtualEnvService extends CacheableLocatorService {
6565
return '';
6666
}));
6767
}
68-
private async getVirtualEnvDetails(interpreter: string): Promise<PythonInterpreter> {
68+
private async getVirtualEnvDetails(interpreter: string): Promise<PythonInterpreter | undefined> {
6969
return Promise.all([
7070
this.helper.getInterpreterInformation(interpreter),
7171
this.virtualEnvMgr.getEnvironmentName(interpreter),

0 commit comments

Comments
 (0)