fix: ignore empty path

This commit is contained in:
lin onetwo 2022-05-08 16:46:35 +08:00
parent 66894a870c
commit c9284ec3c1

View file

@ -50,6 +50,10 @@ export class NativeService implements INativeService {
}
public async openPath(filePath: string): Promise<void> {
// 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)) {