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: Handle null versions in package.json #4461

Merged
merged 1 commit into from
Sep 14, 2017
Merged

Fix: Handle null versions in package.json #4461

merged 1 commit into from
Sep 14, 2017

Conversation

BYK
Copy link
Member

@BYK BYK commented Sep 14, 2017

Summary

Fixes #4429. Apparently there's an advice on the internet to use
null as the package version to install the latest and even worse,
some people are actually doing this. This patch makes sure the
version is at least a string (albeit an empty one) when fixing the
manifest.

Test plan

Added new integration test.

**Summary**

Fixes #4429. Apparently there's an advice on the internet to use
`null` as the package version to install the latest version and
even worse, some people are using this. This patch makes sure
the version is at least a string (albeit an empty one) when
fixing the manifest.

**Test plan**

Added new integration test.
@buildsize
Copy link

buildsize bot commented Sep 14, 2017

This change will increase the build size from 9.69 MB to 9.69 MB, an increase of 224 bytes (0%)

File name Previous Size New Size Change
yarn-[version].noarch.rpm 834.49 KB 834.44 KB -50 bytes (0%)
yarn-[version].js 3.69 MB 3.69 MB 135 bytes (0%)
yarn-legacy-[version].js 3.74 MB 3.74 MB 135 bytes (0%)
yarn-v[version].tar.gz 838.55 KB 838.54 KB -12 bytes (0%)
yarn_[version]all.deb 634.64 KB 634.66 KB 16 bytes (0%)

@bestander
Copy link
Member

typeof null is "object"!
I had to see this bug with my own eyes.

@bestander bestander merged commit 6fdbb39 into master Sep 14, 2017
@BYK
Copy link
Member Author

BYK commented Sep 14, 2017

@bestander or just use flow? 😃

joaolucasl pushed a commit to joaolucasl/yarn that referenced this pull request Oct 27, 2017
**Summary**

Fixes yarnpkg#4429. Apparently there's an advice on the internet to use
`null` as the package version to install the latest version and
even worse, some people are using this. This patch makes sure
the version is at least a string (albeit an empty one) when
fixing the manifest.

**Test plan**

Added new integration test.
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.

An unexpected error occurred: "Path must be a string. Received null".
3 participants