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

fix(util): fix null TypeError in getHashFromImage #446

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

bitknox
Copy link
Contributor

@bitknox bitknox commented Dec 29, 2023

What kind of change does this PR introduce?

bugfix

Summary

The null guard in getImageFromHash was implemented incorrectly causing a null TypeError when the URL is null or undefined. I have not followed up on what is going on with blurhash, but currently, the code does not do anything regardless, so we might be better off removing it.

Copy link
Contributor

@prince-ao prince-ao left a comment

Choose a reason for hiding this comment

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

What does dist/utils/utils.js:160 mean?

if ((url === null || url === void 0 ? void 0 : url.length) === 0) {

@bitknox
Copy link
Contributor Author

bitknox commented Jan 3, 2024

What does dist/utils/utils.js:160 mean?

if ((url === null || url === void 0 ? void 0 : url.length) === 0) {

if (url?.length === 0) {

Looks like the transpiled version of optional chaining. It was added in ES2020, but we are targeting ES2017.

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