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: has_component check #272

Merged
merged 1 commit into from
Nov 16, 2022
Merged

fix: has_component check #272

merged 1 commit into from
Nov 16, 2022

Conversation

eightfilms
Copy link
Contributor

@eightfilms eightfilms commented Nov 15, 2022

Closes #274

Adding an invalid component currently panicks, as reported by @camiinthisthang:

$ fuelup component add [email protected]
thread 'main' panicked at 'no entry found for key', src/toolchain.rs:190:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This is caused by the has_component() check which was checking if a component existed in the currently active toolchain before trying to add it, by doing component[component]. We should use get() instead.

@eightfilms eightfilms added the bug Something isn't working label Nov 15, 2022
@eightfilms eightfilms requested a review from a team November 15, 2022 19:35
@eightfilms eightfilms self-assigned this Nov 15, 2022
@eightfilms eightfilms merged commit 8234768 into master Nov 16, 2022
@eightfilms eightfilms deleted the bing/fix-has-component-check branch November 16, 2022 16:50
@eightfilms eightfilms mentioned this pull request Nov 16, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uninformative 'no entry found for key' panic when adding invalid component
2 participants