Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLI] Use || instead of ?? because getEndpoint() can return "" #984

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

stnguyen90
Copy link
Contributor

@stnguyen90 stnguyen90 commented Sep 19, 2024

What does this PR do?

Since the ?? operator only returns the right side if the left side is null or undefined, it will not work if getEndpoint() returns an empty string. ||, however, will return the right side if the left side is an empty string.

Fixes appwrite/sdk-for-cli#139

Test Plan

Before:

image

After:

image

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

Yes

@stnguyen90 stnguyen90 force-pushed the fix-139-invalid-url branch 2 times, most recently from 51ee938 to 15e8f73 Compare September 19, 2024 20:03
@stnguyen90 stnguyen90 changed the title [CLI] Use || instead of ?? because getEndpoint() can return "" [CLI] Use || instead of ?? because getEndpoint() can return "" Sep 19, 2024
Since the `??` operator only returns the right side if the left side is
null or undefined, it will not work if `getEndpoint()` returns an empty
string. `||`, however, will return the right side if the left side is
an empty string.
@stnguyen90 stnguyen90 merged commit 98cc688 into master Sep 19, 2024
34 checks passed
@stnguyen90 stnguyen90 deleted the fix-139-invalid-url branch September 19, 2024 20:11
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.

🐛 Bug Report: Error: Invalid URL
3 participants