From b4c3ac8ab601670183557cd58f1da33093d438f8 Mon Sep 17 00:00:00 2001 From: Eugene Date: Mon, 15 Jul 2024 23:53:30 +0200 Subject: [PATCH] handle node-powershell failing during icon resolution --- tabby-electron/src/shells/wsl.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tabby-electron/src/shells/wsl.ts b/tabby-electron/src/shells/wsl.ts index bf6bfd34..72f3b34a 100644 --- a/tabby-electron/src/shells/wsl.ts +++ b/tabby-electron/src/shells/wsl.ts @@ -56,7 +56,14 @@ export class WSLShellProvider extends ShellProvider { }) } - private async _resolveIcon (defaultDistKey: any): Promise { + private _resolveIcon (defaultDistKey: any): Promise { + return this._resolveIconInner(defaultDistKey).catch(e => { + console.error('Failed to resolve icon for WSL distribution:', defaultDistKey, e) + return wslIconMap.Linux + }) + } + + private async _resolveIconInner (defaultDistKey: any): Promise { let _icon = wslIconMap.Linux // check if the register has PackageFamilyName