From ef6aa09aa789dbf99c4803f11cdc67c205ca34b0 Mon Sep 17 00:00:00 2001 From: Albert Portnoy Date: Wed, 16 Aug 2023 22:52:37 -0500 Subject: [PATCH] Make it shut up --- src/inject/platforms/win32.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/inject/platforms/win32.ts b/src/inject/platforms/win32.ts index be4e331..a7ad23b 100644 --- a/src/inject/platforms/win32.ts +++ b/src/inject/platforms/win32.ts @@ -1,6 +1,6 @@ import { join, localDataDir } from "@tauri-apps/api/path"; import { DiscordPlatform } from "../../types"; -import { listDir } from "../../util"; +import { exists, listDir } from "../../util"; const PATHS: Record = { stable: "Discord", @@ -12,6 +12,7 @@ const PATHS: Record = { export const getAppDir = async (platform: DiscordPlatform): Promise => { const localAppData = await localDataDir(); const discordPath = await join(localAppData, PATHS[platform]); + if (!(await exists(discordPath))) return null; const discordDirectory = await listDir(discordPath); const currentBuild = discordDirectory.filter((path) => path?.startsWith("app-")).reverse()[0];