From 2436223891fffd329844aba962bc5bb588bed195 Mon Sep 17 00:00:00 2001 From: almeidx Date: Wed, 9 Mar 2022 19:50:49 +0000 Subject: [PATCH] fix(GuildScheduledEvent): handle missing `image` for v13 --- 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; + } } /**