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];