Skip to content

fix "null" in stripe donor names#199

Merged
pkscout merged 2 commits intomainfrom
stripe-donor-name
Jun 6, 2021
Merged

fix "null" in stripe donor names#199
pkscout merged 2 commits intomainfrom
stripe-donor-name

Conversation

@yol
Copy link
Copy Markdown
Member

@yol yol commented Jun 6, 2021

By default, state.donor and state.forum are null, but null != "", so the null gets copied into the stripe request and converted to the string null. Work around this by defaulting to "".

By default, state.donor and state.forum are `null`, but `null != ""`, so the `null` gets copied into the stripe request and converted to the string `null`. Work around this by defaulting to `""`.
@yol yol added this to the Now milestone Jun 6, 2021
@yol yol requested a review from pkscout June 6, 2021 07:29
@yol yol self-assigned this Jun 6, 2021
@yol yol mentioned this pull request Jun 6, 2021
@pkscout pkscout merged commit d9e2e3a into main Jun 6, 2021
],
mode: "subscription",
clientReferenceId: props.donorname + sep + props.forumname,
clientReferenceId: (props.donorname || "") + sep + (props.forumname || ""),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While this is fine, you might want to use ?? in the future, as there is a slight difference.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the hint, I don't have that much JS experience. What would the difference be in this case?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@yol yol deleted the stripe-donor-name branch June 6, 2021 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants