From cd06ae3e7881efabe93b1093d1ac7ccba8f32eea Mon Sep 17 00:00:00 2001 From: NBA2K1 <78034913+NBA2K1@users.noreply.github.com> Date: Mon, 28 Jul 2025 17:19:39 +0200 Subject: [PATCH] Fix Exception when disconnecting When restoring a backup, the app tries to disconnect DiscordRPC but that gives an exception, when there is no live IPC socket to close. `AnyhowException (AnyhowException(Failed to close to Discord IPC: Custom { kind: ConnectionRefused, error: "Couldn't retrieve the Discord IPC socket" }` --- lib/utils/discord_rpc.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/utils/discord_rpc.dart b/lib/utils/discord_rpc.dart index 6b821cd4..558abc56 100644 --- a/lib/utils/discord_rpc.dart +++ b/lib/utils/discord_rpc.dart @@ -203,6 +203,7 @@ class DiscordRPC { } Future disconnect() async { + if (!FlutterDiscordRPC.instance.isConnected) return; await FlutterDiscordRPC.instance.disconnect(); }