From b624218feb042eddeb96b48b5bc90d3cb6b1de4f Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sat, 14 Jan 2023 19:41:34 +0100 Subject: [PATCH] fixed #7745 - skip incorrect WSL registry entries --- tabby-local/src/shells/wsl.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tabby-local/src/shells/wsl.ts b/tabby-local/src/shells/wsl.ts index c91d997b..4dfb0aca 100644 --- a/tabby-local/src/shells/wsl.ts +++ b/tabby-local/src/shells/wsl.ts @@ -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 = { @@ -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