From 725cdb035ae0f068ad8069010ea0abfef8cf35b2 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Tue, 24 May 2022 15:53:40 +0800 Subject: [PATCH] Merge pull request #18305 from lesha1201/fix/open-in-browser-for-wsl CLI: Fix open in browser doesn't work in WSL --- lib/core-server/src/utils/open-in-browser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core-server/src/utils/open-in-browser.ts b/lib/core-server/src/utils/open-in-browser.ts index daa5938b3f07..bf98fbf9dd48 100644 --- a/lib/core-server/src/utils/open-in-browser.ts +++ b/lib/core-server/src/utils/open-in-browser.ts @@ -7,7 +7,7 @@ import dedent from 'ts-dedent'; export function openInBrowser(address: string) { getDefaultBrowser(async (err: any, res: any) => { try { - if (res.isChrome || res.isChromium) { + if (res && (res.isChrome || res.isChromium)) { // We use betterOpn for Chrome because it is better at handling which chrome tab // or window the preview loads in. betterOpn(address);