Skip to content

Commit a4c3170

Browse files
authored
Fix for a crash when loading environments with no info (#18598)
1 parent bc4880a commit a4c3170

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

news/2 Fixes/18594.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix for a crash when loading environments with no info.

src/client/interpreter/display/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle
119119
);
120120
this.interpreterPath = interpreter.path;
121121
}
122-
let text = interpreter.detailedDisplayName!;
122+
let text = interpreter.detailedDisplayName;
123123
if (this.experiments.inExperimentSync(InterpreterStatusBarPosition.Pinned)) {
124-
text = text.startsWith('Python') ? text.substring('Python'.length).trim() : text;
124+
text = text?.startsWith('Python') ? text?.substring('Python'.length)?.trim() : text;
125125
}
126-
this.statusBar.text = text;
126+
this.statusBar.text = text!;
127127
this.currentlySelectedInterpreterPath = interpreter.path;
128128
} else {
129129
this.statusBar.tooltip = '';

0 commit comments

Comments
 (0)