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

Error when attempting to jump to a file by clicking on an analysis result #30

Open
farazsth98 opened this issue Dec 28, 2022 · 0 comments

Comments

@farazsth98
Copy link

Slither version: 0.8.3
Repository: https://github.com/fluidity-money/fluidity-app (specifically the contracts/ethereum directory)

I'm able to run slither through the extension just fine, and it shows up with a bunch of issues. However, when clicking on an issue to jump to the file containing the issue, I get a Error: cannot read properties of undefined (reading 'length') error.

You can reproduce it by doing the following:

  1. Install slither version 0.8.3 (unsure if that matters)
  2. Clone the repository from above
  3. cd to the contracts/ethereum directory
  4. Run yarn
  5. Run slither . (it should run successfully now)
  6. Run slither through the VSC extension.
  7. Attempt to jump to an issue by clicking on it through the Slither Analysis tab

From my quick attempt at debugging this issue, it seems like the problem is in this line of code:

export async function gotoResultCode(workspaceFolder : string, result : SlitherResult) {
    try {
        // If there are no elements for this check which map to source, we stop.
        if (result.elements.length <= 0 || !result.elements[0].source_mapping) {

        // ...
    } catch (r) {
        // Log our error.
        Logger.error(r.message);
    }
}

Here, result.elements is undefined.

Let me know if there's any other information I can provide to assist with this :)

@farazsth98 farazsth98 changed the title Cannot jump to file by clicking on an issue in the Analysis tab Error when attempting to jump to a file by clicking on an analysis result Dec 28, 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

No branches or pull requests

1 participant