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" }`
This commit is contained in:
NBA2K1 2025-07-28 17:19:39 +02:00
parent 36a2232461
commit cd06ae3e78

View file

@ -203,6 +203,7 @@ class DiscordRPC {
}
Future<void> disconnect() async {
if (!FlutterDiscordRPC.instance.isConnected) return;
await FlutterDiscordRPC.instance.disconnect();
}