fix: Check error 404 and return null for GetBanAsync (#1614)

This commit is contained in:
Paulo
2020-10-28 18:03:08 -03:00
committed by GitHub
parent bd4516b035
commit ae9fff6380
2 changed files with 7 additions and 3 deletions

View File

@@ -132,7 +132,7 @@ namespace Discord.Rest
public static async Task<RestBan> GetBanAsync(IGuild guild, BaseDiscordClient client, ulong userId, RequestOptions options)
{
var model = await client.ApiClient.GetGuildBanAsync(guild.Id, userId, options).ConfigureAwait(false);
return RestBan.Create(client, model);
return model == null ? null : RestBan.Create(client, model);
}
public static async Task AddBanAsync(IGuild guild, BaseDiscordClient client,