From 497a34287455c46cda72af985fe202fa26614683 Mon Sep 17 00:00:00 2001 From: Athul Raj Date: Sun, 30 Apr 2023 11:17:37 +0530 Subject: [PATCH] fix crash when discord rich presence disabled. --- .../Services/MediaEvents/DiscordRichPresenseUpdater.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Totoro.Core/Services/MediaEvents/DiscordRichPresenseUpdater.cs b/Totoro.Core/Services/MediaEvents/DiscordRichPresenseUpdater.cs index b6505286..4fb4dd04 100644 --- a/Totoro.Core/Services/MediaEvents/DiscordRichPresenseUpdater.cs +++ b/Totoro.Core/Services/MediaEvents/DiscordRichPresenseUpdater.cs @@ -19,6 +19,12 @@ public DiscordRichPresenseUpdater(IDiscordRichPresense discordRichPresense, protected override void OnDurationChanged(TimeSpan duration) { _duration = duration; + + if (!_settings.UseDiscordRichPresense) + { + return; + } + _discordRichPresense.UpdateTimer(_duration - _currentTime); }