Archived
0
0
Fork 0

fix: crashing if user doesn't have access to channel

This commit is contained in:
Daryl Ronningen 2021-12-17 19:39:16 -07:00
parent 57734b62dd
commit 1d940b0f7d
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B

View file

@ -186,6 +186,7 @@ namespace chord
return; return;
} }
try {
var restSharpClient = new RestClient("https://discord.com/api/v9"); var restSharpClient = new RestClient("https://discord.com/api/v9");
var restSharpReq = new RestRequest($"channels/{currentSelectedChannel}/messages"); var restSharpReq = new RestRequest($"channels/{currentSelectedChannel}/messages");
restSharpClient.AddDefaultHeader("Authorization", settings.Token); restSharpClient.AddDefaultHeader("Authorization", settings.Token);
@ -243,6 +244,9 @@ namespace chord
{ {
userListTree.AddObject(role.Value); userListTree.AddObject(role.Value);
} }
} catch {
await chatBoxList.SetSourceAsync(new List<string>());
}
}; };
messageBoxSend.Clicked += async () => messageBoxSend.Clicked += async () =>