From c1eb06e02d5a03221fb4719b67fe5e8320b46c47 Mon Sep 17 00:00:00 2001 From: FiniteReality Date: Fri, 24 Aug 2018 00:18:50 +0100 Subject: [PATCH] Handle the case where webhookInfo is null --- .../Entities/AuditLogs/DataTypes/WebhookUpdateAuditLogData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookUpdateAuditLogData.cs b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookUpdateAuditLogData.cs index 409b60549..ad7db53e2 100644 --- a/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookUpdateAuditLogData.cs +++ b/src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/WebhookUpdateAuditLogData.cs @@ -37,7 +37,7 @@ namespace Discord.Rest var after = new WebhookInfo(newName, newChannelId, newAvatar); var webhookInfo = log.Webhooks?.FirstOrDefault(x => x.Id == entry.TargetId); - var webhook = RestWebhook.Create(discord, (IGuild)null, webhookInfo); + var webhook = webhookInfo != null ? RestWebhook.Create(discord, (IGuild)null, webhookInfo) : null; return new WebhookUpdateAuditLogData(webhook, before, after); }