File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ describe("Shell Detection Tests", () => {
7878 expect ( getShell ( ) ) . to . equal ( "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" )
7979 } )
8080
81+ it ( "handles undefined shell profile gracefully" , ( ) => {
82+ mockVsCodeConfig ( "windows" , "NonExistentProfile" , { } )
83+ expect ( getShell ( ) ) . to . equal ( "C:\\Windows\\System32\\cmd.exe" )
84+ } )
85+
8186 it ( "uses WSL bash when profile indicates WSL source" , ( ) => {
8287 mockVsCodeConfig ( "windows" , "WSL" , {
8388 WSL : { source : "WSL" } ,
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ function getWindowsShellFromVSCode(): string | null {
105105 }
106106
107107 // If there's a specific path, return that immediately
108- if ( profile . path ) {
108+ if ( profile ? .path ) {
109109 return profile . path
110110 }
111111
You can’t perform that action at this time.
0 commit comments