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: prevent crash when the pad amount is negative #8747

Merged
merged 1 commit into from Jun 30, 2022

Conversation

Haegin
Copy link
Contributor

@Haegin Haegin commented Jun 23, 2022

Description

If the start is less than the (count - lineLength) + 1 pad will be negative and cause the call to repeat on line 477 to crash with an uncaught RangeError. This caused Vite to crash when I was converting an app from Create React App to use Vite.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

This is my first time contributing to Vite (and nearly my first day using Vite), so please let me know if I've missed any steps or need to add anything.

If the start is less than the (count - lineLength) + 1 pad will be negative and cause the call to repeat on line 477 to crash with an uncaught RangeError.
@netlify
Copy link

netlify bot commented Jun 23, 2022

Deploy Preview for vite-docs-main ready!

Name Link
🔨 Latest commit 5b0e1cb
🔍 Latest deploy log https://app.netlify.com/sites/vite-docs-main/deploys/62b4abe0e638bc0007b064eb
😎 Deploy Preview https://deploy-preview-8747--vite-docs-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@patak-dev
Copy link
Member

LGTM, it would be great to have a link to the project for reference if it is public. Or an explanation of the setup at least if not.

@bluwy bluwy changed the title Prevent crash when the pad amount is negative fix: prevent crash when the pad amount is negative Jun 24, 2022
@patak-dev patak-dev merged commit 3af6a1b into vitejs:main Jun 30, 2022
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.

None yet

2 participants