Skip to content

Commit

Permalink
Added check to see if an error was returned while attempting to downl…
Browse files Browse the repository at this point in the history
…oad profile
  • Loading branch information
nexus4880 committed Jul 13, 2024
1 parent 566c9b3 commit 7ee69a0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Fika.Core/UI/Patches/MenuTaskBar_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ public static void Postfix(MenuTaskBar __instance)
try
{
JObject profile = await FikaRequestHandler.GetProfile();

if (profile != null)
bool responseHasError = profile.ContainsKey("errmsg");
string error = responseHasError ? profile.Value<string>("errmsg") : "Failed to retrieve profile";
if (!responseHasError && profile != null)
{
Singleton<GUISounds>.Instance.PlayUISound(EUISoundType.ButtonBottomBarClick);
string installDir = Environment.CurrentDirectory;
Expand Down Expand Up @@ -92,7 +93,7 @@ public static void Postfix(MenuTaskBar __instance)
}
else
{
NotificationManagerClass.DisplayWarningNotification("Failed to retrieve profile");
NotificationManagerClass.DisplayWarningNotification(error);
}
}
catch (Exception ex)
Expand Down

0 comments on commit 7ee69a0

Please sign in to comment.