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

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

Merged
merged 1 commit into from
Oct 20, 2016

Conversation

arthepsy
Copy link
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
2 participants