Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Fix error message on hitting v in debugger with no tx loaded #5694

Merged
merged 2 commits into from
Nov 10, 2022

Conversation

haltman-at
Copy link
Contributor

Once again, the CLI debugger was erroring if you hit v with no transaction loaded. The problem comes from the data.current.identifiers.sections selector; this would error if no transaction was loaded. So basically I added the appropriate guards to allow it to return something in this case; I'll skip going into detail because frankly it's nothing interesting.

Don't be scared by what looks like a gigantic change to complicated code on lines 684 to 767; the only difference is that the whole thing is now within a big scopes && inlined ? oldStuff : null. None of the complicated parts were altered at all! Most of those lines just had their indentation changed! I guess you can turn off whitespace changes to make this more evident.

I didn't add any tests, but this is easy enough to test manually; go into a Truffle project, start up ganache, and do truffle debug and then v. Hopefully you didn't see an error message!

Alternative I could have just fixed this on the CLI side by not asking for that selector in this case, but, IDK, I liked this approach. 🤷

Also, while I was at it, I removed a use of the obsolete indicateUnknown option.

Copy link
Member

@cds-amal cds-amal left a comment

Choose a reason for hiding this comment

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

Looks good, and the error is gone!

@haltman-at haltman-at merged commit f87aea6 into develop Nov 10, 2022
@haltman-at haltman-at deleted the verror branch November 10, 2022 23:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants