Skip to content

bugfix: fix prospector linter to not fail on unset line number.#399

Merged
DonJayamanne merged 1 commit into
DonJayamanne:masterfrom
arthepsy:bugfix-prospector
Oct 20, 2016
Merged

bugfix: fix prospector linter to not fail on unset line number.#399
DonJayamanne merged 1 commit into
DonJayamanne:masterfrom
arthepsy:bugfix-prospector

Conversation

@arthepsy
Copy link
Copy Markdown
Contributor

While using prospector linter, I encountered strange behavior. It gave this output:

Linting with prospector failed.
TypeError: Cannot read property 'substring' of undefined

Debugged the code and found out that it was crashing on this PEP8 message:

E101: indentation contains mixed spaces and tabs

Turns out, this particular lint message (and probably others aswell), doesn't contain line number, therefore, in src/client/linters/prospector.ts, this line

let sourceLine = txtDocumentLines[msg.location.line - 1];

got assigned undefined and the next line

let sourceStart = sourceLine.substring(msg.location.character);

crashed with error mentioned above.

This pull request fixes the issue.

@DonJayamanne DonJayamanne merged commit 114bbf3 into DonJayamanne:master Oct 20, 2016
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.

2 participants