Skip to content

Commit

Permalink
Fix serverIP not found exception in DiscordPresence
Browse files Browse the repository at this point in the history
  • Loading branch information
Plextora committed May 28, 2024
1 parent a65d56d commit 0422e1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion LatiteInjector/Utils/DiscordPresence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public static void PlayingPresence()

public static void DetailedPlayingPresence(object? sender, ElapsedEventArgs e)
{
string serverIP = File.ReadAllText($@"{Logging.LatiteFolder}\Logs\serverip.txt");
string serverIP = "none";
if (File.Exists($@"{Logging.LatiteFolder}\Logs\serverip.txt"))
File.ReadAllText($@"{Logging.LatiteFolder}\Logs\serverip.txt");

if (!SettingsWindow.IsDiscordPresenceEnabled || !Injector.IsMinecraftRunning()) return;
if (SupportedPresenceDict.TryGetValue(serverIP, out PresenceDetails presenceDetails))
Expand Down

0 comments on commit 0422e1f

Please sign in to comment.