Skip to content

Self-hosted: Team Event Created without explicitly setting locations crashes on /booking page#5457

Merged
kodiakhq[bot] merged 3 commits into
mainfrom
fix/team-booking-event-without-location
Nov 10, 2022
Merged

Self-hosted: Team Event Created without explicitly setting locations crashes on /booking page#5457
kodiakhq[bot] merged 3 commits into
mainfrom
fix/team-booking-event-without-location

Conversation

@hariombalhara
Copy link
Copy Markdown
Member

In self-hosted, calvideo isn't default and thus an event can be created without locations

This error comes right now on local, while booking such an event.

Screenshot 2022-11-10 at 2 33 22 PM

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 10, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Nov 10, 2022 at 11:03AM (UTC)

@hariombalhara hariombalhara requested a review from a team November 10, 2022 09:04
@what-the-diff
Copy link
Copy Markdown

what-the-diff Bot commented Nov 10, 2022

  • Added a default value to the locations property of eventTypeRaw
  • Changed Type Assertion from eventTypeRaw.locations as LocationObject[] to (eventTypeRaw.locations || []) as LocationObject[]. This is because we are not sure if there will be any location objects in the array or not, so it's better to use an empty array instead of null/undefined values which can cause errors later on when trying to access properties that don't exist (e.g., accessing .length property on undefined).

Copy link
Copy Markdown
Member

@sean-brydon sean-brydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Good catch

@hariombalhara hariombalhara added ♻️ autoupdate tells kodiak to keep this branch up-to-date automerge labels Nov 10, 2022
@kodiakhq kodiakhq Bot merged commit 04e62a1 into main Nov 10, 2022
@kodiakhq kodiakhq Bot deleted the fix/team-booking-event-without-location branch November 10, 2022 11:07
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge ♻️ autoupdate tells kodiak to keep this branch up-to-date core area: core, team members only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants