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

Add guards against nulls that happened in the HoverProvider code #1025

Merged
merged 1 commit into from Oct 28, 2019

Conversation

@tgodzik
Copy link
Collaborator

tgodzik commented Oct 28, 2019

This is based on stack traces I had while working on Metals:

Oct 28, 2019 6:42:47 PM scala.meta.internal.pc.CompilerAccess handleError
SEVERE: null
java.lang.NullPointerException
	at scala.meta.internal.pc.HoverProvider.seenFromType(HoverProvider.scala:106)
	at scala.meta.internal.pc.HoverProvider.hover(HoverProvider.scala:42)

Oct 28, 2019 6:44:16 PM scala.meta.internal.pc.CompilerAccess handleError
SEVERE: null
java.lang.NullPointerException
	at scala.meta.internal.pc.HoverProvider.hover(HoverProvider.scala:37)

Might be connected to the bug report we clsoed previously.

@tgodzik tgodzik changed the title Add guards against nulls that sometime happened in the code Add guards against nulls that happened in the HoverProvider code Oct 28, 2019
Copy link
Member

olafurpg left a comment

LGTM 👍 Thank you!

@@ -32,7 +33,8 @@ class HoverProvider(val compiler: MetalsGlobal, params: OffsetParams) {
val expanded = expandRangeToEnclosingApply(pos)
if (expanded != null &&
expanded.tpe != null &&
tree.symbol != null) {
tree.symbol != null &&
expanded.symbol != null) {

This comment has been minimized.

Copy link
@olafurpg

This comment has been minimized.

Copy link
@tgodzik

tgodzik Oct 28, 2019

Author Collaborator

That's the only thing we didn't check haha

@tgodzik tgodzik merged commit 62ff4c1 into scalameta:master Oct 28, 2019
7 of 8 checks passed
7 of 8 checks passed
Linux unit tests
Details
Sbt integration
Details
Maven integration Maven integration
Details
Gradle integration
Details
Mill integration
Details
Slow tests
Details
Scala cross tests
Details
Scalafmt/Scalacheck/Docs
Details
@tgodzik tgodzik deleted the tgodzik:guard-nulls branch Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.