Skip to content

Commit

Permalink
fix(GuildScheduledEvent): handle null recurrence_rule (#10543)
Browse files Browse the repository at this point in the history
* fix(GuildScheduledEvent): handle null recurrence_rule

* refactor: consistency

* feat: implement suggested logic change

* fix: correct data.recurrence_rule check

---------

Co-authored-by: Almeida <github@almeidx.dev>
  • Loading branch information
Eejit43 and almeidx authored Oct 11, 2024
1 parent c36728a commit 1925c11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/discord.js/src/structures/GuildScheduledEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class GuildScheduledEvent extends Base {
* The recurrence rule for this scheduled event
* @type {?GuildScheduledEventRecurrenceRule}
*/
this.recurrenceRule = {
this.recurrenceRule = data.recurrence_rule && {
startTimestamp: Date.parse(data.recurrence_rule.start),
get startAt() {
return new Date(this.startTimestamp);
Expand Down

0 comments on commit 1925c11

Please sign in to comment.