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: Index out of range in examples/credit-card-form when ccn is empty #770

Conversation

grafviktor
Copy link
Contributor

@grafviktor grafviktor commented Jun 29, 2023

Fixes Index out of range error in examples/credit-card-form when credit card number(CCN) is not provided.

To reproduce:

  • Run examples/credit-card-form/main.go
  • Do not type anything in "Card number"
  • Press UP or DOWN keys on your keboard (or press TAB several times)

ccnValidator will trigger and will attempt to read a symbol which is located at len("")-1, that will cause Index out of range error (because CCN is empty).

@maaslalani maaslalani merged commit c1b0b19 into charmbracelet:master Jun 29, 2023
9 checks passed
@maaslalani
Copy link
Member

Thanks so much!

@grafviktor grafviktor deleted the fix-index-out-of-range-in-credit-card-example branch June 30, 2023 11:12
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