Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Added safety code for calling service
Browse files Browse the repository at this point in the history
  • Loading branch information
emako committed May 1, 2023
1 parent b370895 commit 90ac2cd
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/GenshinSwitch.Fetch/Regedit/GenshinRegedit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ internal static string GetStringFromRegedit(string key, GameType type = GameType
{
if (MainService.ServiceEnabled)
{
return MainService.GetGameAccountRegisty(key, type);
try
{
return MainService.GetGameAccountRegisty(key, type);
}
catch
{
return null!;
}
}

#if DISPSREG
Expand Down Expand Up @@ -126,7 +133,13 @@ internal static void SetStringToRegedit(string key, string value, GameType type
{
if (MainService.ServiceEnabled)
{
MainService.SetGameAccountRegisty(key, value, type);
try
{
MainService.SetGameAccountRegisty(key, value, type);
}
catch
{
}
return;
}

Expand Down

0 comments on commit 90ac2cd

Please sign in to comment.