Skip to content

Commit

Permalink
fixed #7745 - skip incorrect WSL registry entries
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Jan 14, 2023
1 parent 62d2735 commit b624218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tabby-local/src/shells/wsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class WSLShellProvider extends ShellProvider {
const lxss = wnr.getRegistryKey(wnr.HK.CU, lxssPath)
const shells: Shell[] = []

if (null != lxss && null != lxss.DefaultDistribution) {
if (lxss?.DefaultDistribution) {
const defaultDistKey = wnr.getRegistryKey(wnr.HK.CU, lxssPath + '\\' + String(lxss.DefaultDistribution.value))
if (defaultDistKey?.DistributionName) {
const shell: Shell = {
Expand Down Expand Up @@ -92,7 +92,7 @@ export class WSLShellProvider extends ShellProvider {
}
for (const child of wnr.listRegistrySubkeys(wnr.HK.CU, lxssPath) as string[]) {
const childKey = wnr.getRegistryKey(wnr.HK.CU, lxssPath + '\\' + child)
if (!childKey.DistributionName) {
if (!childKey.DistributionName || !childKey.BasePath) {
continue
}
const wslVersion = (childKey.Flags?.value || 0) & 8 ? 2 : 1
Expand Down

0 comments on commit b624218

Please sign in to comment.