don't crash on missing wsl distro flags - fixes #2744

上级 6e9ac1b5
...@@ -88,7 +88,7 @@ export class WSLShellProvider extends ShellProvider { ...@@ -88,7 +88,7 @@ export class WSLShellProvider extends ShellProvider {
if (!childKey.DistributionName) { if (!childKey.DistributionName) {
continue continue
} }
const wslVersion = childKey.Flags.value & 8 ? 2 : 1 const wslVersion = (childKey.Flags?.value || 0) & 8 ? 2 : 1
const name = childKey.DistributionName.value const name = childKey.DistributionName.value
const fsBase = wslVersion === 2 ? `\\\\wsl$\\${name}` : childKey.BasePath.value as string + '\\rootfs' const fsBase = wslVersion === 2 ? `\\\\wsl$\\${name}` : childKey.BasePath.value as string + '\\rootfs'
const slug = slugify(name, { remove: /[:.]/g }) const slug = slugify(name, { remove: /[:.]/g })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册