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

check if process.version is available #85

Merged
merged 1 commit into from
May 7, 2020

Conversation

chaeron
Copy link
Contributor

@chaeron chaeron commented Jul 20, 2019

I use the Hapi Joi module in Nativescript for validations, because it's a cool validation module.

And Joi drags in pbkdf2, but the native app isn't running in Node so there is no process.version variable, and it causes the app to crash.

This minor code change just adds a check to see if process.version is defined and if it's not, it defaults the encoding to UTF-8, similar to the browser scenario, thus keeping Joi from crashing.

Shouldn't make any difference in a Node environment....but sure helps otherwise! ;-)

Thanks!

@AlexBa
Copy link

AlexBa commented Jan 30, 2020

I have the same problem with Nativescript...

Copy link

@dalinarkholin dalinarkholin left a comment

Choose a reason for hiding this comment

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

yeah this is needed in my opinion. Just ran into this issue in React Native.

@calvinmetcalf calvinmetcalf merged commit e4fc8b6 into browserify:master May 7, 2020
guimard added a commit to guimard/pbkdf2 that referenced this pull request Jan 19, 2022
guimard added a commit to guimard/pbkdf2 that referenced this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants