From dfea9c27cef4ec7472c39675c93de985b43fee87 Mon Sep 17 00:00:00 2001 From: Almeida Date: Thu, 24 Mar 2022 19:59:19 +0000 Subject: [PATCH] fix(GuildScheduledEvent): handle missing `image` for v13 (#7627) --- src/structures/GuildScheduledEvent.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/structures/GuildScheduledEvent.js b/src/structures/GuildScheduledEvent.js index 263a7de58a0a..5be66d823921 100644 --- a/src/structures/GuildScheduledEvent.js +++ b/src/structures/GuildScheduledEvent.js @@ -157,11 +157,15 @@ class GuildScheduledEvent extends Base { this.entityMetadata ??= null; } - /** - * The cover image hash for this scheduled event - * @type {?string} - */ - this.image = data.image ?? null; + if ('image' in data) { + /** + * The cover image hash for this scheduled event + * @type {?string} + */ + this.image = data.image; + } else { + this.image ??= null; + } } /**