From a930c123ed28017e5b6cfa3cf146b475c0ab1a01 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Thu, 7 Oct 2021 18:06:50 +0200 Subject: [PATCH] Initialize the Discord rich presence with an empty presence --- OpenRA.Mods.Common/DiscordService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Mods.Common/DiscordService.cs b/OpenRA.Mods.Common/DiscordService.cs index 0a1b39ff03..ff5a70e93d 100644 --- a/OpenRA.Mods.Common/DiscordService.cs +++ b/OpenRA.Mods.Common/DiscordService.cs @@ -79,6 +79,9 @@ namespace OpenRA.Mods.Common client.SetSubscription(EventType.Join | EventType.JoinRequest); client.Initialize(); + + // Set an initial value for the rich presence to avoid a NRE in the library + client.SetPresence(new RichPresence()); } void OnJoinRequested(object sender, JoinRequestMessage args)