Skip to content

Commit

Permalink
Fix potential crash in champ select
Browse files Browse the repository at this point in the history
  • Loading branch information
floh22 committed Sep 9, 2021
1 parent c692c18 commit 7ef20cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions LeagueBroadcast/Common/Controllers/AppStateController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,14 @@ public static async Task CacheSummoners(Session session)

public static async Task<Timer> GetTimer()
{
//Crash here
return JsonConvert.DeserializeObject<Timer>(await Instance.ClientAPI.RequestHandler.GetJsonResponseAsync(HttpMethod.Get, $"/lol-champ-select/v1/session/timer"));
try
{
return JsonConvert.DeserializeObject<Timer>(await Instance.ClientAPI.RequestHandler.GetJsonResponseAsync(HttpMethod.Get, $"/lol-champ-select/v1/session/timer"));
}
catch
{
return null;
}
}

private static Dictionary<Cell, Task<string>> FetchPlayersFromTeam(List<Cell> team)
Expand Down

0 comments on commit 7ef20cf

Please sign in to comment.