From c9284ec3c19fac80cc7853fa06e739947990c7d9 Mon Sep 17 00:00:00 2001 From: lin onetwo Date: Sun, 8 May 2022 16:46:35 +0800 Subject: [PATCH] fix: ignore empty path --- src/services/native/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/native/index.ts b/src/services/native/index.ts index 345fc309..f24880f4 100644 --- a/src/services/native/index.ts +++ b/src/services/native/index.ts @@ -50,6 +50,10 @@ export class NativeService implements INativeService { } public async openPath(filePath: string): Promise { + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (!filePath.trim()) { + return; + } logger.debug(`NativeService.openPath() Opening ${filePath}`); // TODO: add a switch that tell user these are dangerous features, use at own risk. if (path.isAbsolute(filePath)) {