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 plot crashing on /plot visit [anything here] 0, issue #72 #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Olek47
Copy link
Contributor

@Olek47 Olek47 commented Sep 15, 2022

No description provided.

@@ -98,7 +98,7 @@ impl Plot {

let idx = if args.len() == 2 {
match args[1].parse::<usize>() {
Ok(idx) => idx - 1,
Ok(idx) => idx.wrapping_sub(1),
Copy link
Member

Choose a reason for hiding this comment

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

wrapping_sub here probably isn't right. I'd imagine we want to send an error message if idx is 0 since that's not a valid plot id.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will send the Plot range (1, {}). message unless someone has usize::MAX plots which is already impossible due to memory limit.

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