From 11c8ca6582f673cee1fcf0284ae229b81fe48980 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Tue, 30 Jun 2020 15:34:55 +0200 Subject: [PATCH] don't crash on missing wsl distro flags - fixes #2744 --- terminus-terminal/src/shells/wsl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminus-terminal/src/shells/wsl.ts b/terminus-terminal/src/shells/wsl.ts index 696873f5..7ba58ed7 100644 --- a/terminus-terminal/src/shells/wsl.ts +++ b/terminus-terminal/src/shells/wsl.ts @@ -88,7 +88,7 @@ export class WSLShellProvider extends ShellProvider { if (!childKey.DistributionName) { continue } - const wslVersion = childKey.Flags.value & 8 ? 2 : 1 + const wslVersion = (childKey.Flags?.value || 0) & 8 ? 2 : 1 const name = childKey.DistributionName.value const fsBase = wslVersion === 2 ? `\\\\wsl$\\${name}` : childKey.BasePath.value as string + '\\rootfs' const slug = slugify(name, { remove: /[:.]/g })