Skip to content

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

Open
@farazsth98

Description

@farazsth98

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions