1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-22 11:52:03 +03:00

fixed #7745 - skip incorrect WSL registry entries

This commit is contained in:
Eugene Pankov 2023-01-14 19:41:34 +01:00
parent 62d2735f86
commit b624218feb
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -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