Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Jul 3, 2019
1 parent 818dc62 commit 7621eef
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ export abstract class BaseShellDetector implements IShellDetector {
public identifyShellFromShellPath(shellPath: string): TerminalShellType {
const shell = Array.from(detectableShells.keys())
.reduce((matchedShell, shellToDetect) => {
if (matchedShell === TerminalShellType.other && detectableShells.get(shellToDetect)!.test(shellPath)) {
return shellToDetect;
if (matchedShell === TerminalShellType.other) {
const pat = detectableShells.get(shellToDetect);
if (pat && pat.test(shellPath)) {
return shellToDetect;
}
}
return matchedShell;
}, TerminalShellType.other);
Expand Down

0 comments on commit 7621eef

Please sign in to comment.