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

NavigateToDefinitionHandler doesn't check null which will cause NullPointerException #963

Closed
Poytr1 opened this issue Mar 19, 2019 · 2 comments · Fixed by #965
Closed

NavigateToDefinitionHandler doesn't check null which will cause NullPointerException #963

Poytr1 opened this issue Mar 19, 2019 · 2 comments · Fixed by #965
Labels

Comments

@Poytr1
Copy link

Poytr1 commented Mar 19, 2019

This issue is related to: #879
https://github.com/eclipse/eclipse.jdt.ls/blob/ca81aa7b935b52c0aff7624fa9f330c832578233/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/NavigateToDefinitionHandler.java#L79
The location here may be null, and if it is, a NullPointerException will be thrown which isn't caught as well.

The interesting thing is that when I goto definition on java.lang.string in macOS, this exception doesn't occur while it occurs on Linux. Not sure if it has anything to do with the if logic above.

Following is the stack trace(caught):

java.lang.NullPointerException
        at org.eclipse.jdt.ls.core.internal.handlers.NavigateToDefinitionHandler.fixLocation(NavigateToDefinitionHandler.java:79)
        at org.eclipse.jdt.ls.core.internal.handlers.NavigateToDefinitionHandler.computeDefinitionNavigation(NavigateToDefinitionHandler.java:62)
        at org.eclipse.jdt.ls.core.internal.handlers.NavigateToDefinitionHandler.definition(NavigateToDefinitionHandler.java:45)
...
@yaohaizh
Copy link
Contributor

@Poytr1 Would you open a PR for this issue?

@Poytr1
Copy link
Author

Poytr1 commented Mar 19, 2019

@Poytr1 Would you open a PR for this issue?

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants