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

NPE in QuteHover.doHoverForPropertyPart ("project" is null) #923

Open
fbricon opened this issue Aug 11, 2023 · 3 comments
Open

NPE in QuteHover.doHoverForPropertyPart ("project" is null) #923

fbricon opened this issue Aug 11, 2023 · 3 comments
Labels
bug Something isn't working hover qute

Comments

@fbricon
Copy link
Collaborator

fbricon commented Aug 11, 2023

Seen this exception while hovering in qute template, during intellij project startup:

SEVERE: Internal error: java.lang.NullPointerException: Cannot invoke "com.redhat.qute.project.QuteProject.resolveJavaType(com.redhat.qute.parser.expression.Part)" because "project" is null
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "com.redhat.qute.project.QuteProject.resolveJavaType(com.redhat.qute.parser.expression.Part)" because "project" is null
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.NullPointerException: Cannot invoke "com.redhat.qute.project.QuteProject.resolveJavaType(com.redhat.qute.parser.expression.Part)" because "project" is null
	at com.redhat.qute.services.QuteHover.doHoverForPropertyPart(QuteHover.java:444)
	at com.redhat.qute.services.QuteHover.doHoverForExpressionPart(QuteHover.java:211)
	at com.redhat.qute.services.QuteHover.doHover(QuteHover.java:105)
	at com.redhat.qute.services.QuteLanguageService.doHover(QuteLanguageService.java:200)
Caused by: java.lang.NullPointerException: Cannot invoke "com.redhat.qute.project.QuteProject.resolveJavaType(com.redhat.qute.parser.expression.Part)" because "project" is null

	at com.redhat.qute.ls.template.TemplateFileTextDocumentService.lambda$hover$10(TemplateFileTextDocumentService.java:202)
	at com.redhat.qute.ls.commons.ModelTextDocuments.lambda$computeModelAsyncCompose$1(ModelTextDocuments.java:144)
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)
	... 6 more
@fbricon fbricon added bug Something isn't working hover qute labels Aug 11, 2023
@angelozerr
Copy link
Contributor

LSPTextHover should be rewritten because it stores lsp request in the class although this hover is a singleton shared with all files.

@fbricon
Copy link
Collaborator Author

fbricon commented Aug 11, 2023

still, qute-ls should be more robust and check for a non-null project

@angelozerr
Copy link
Contributor

I'm not sure but I think the real problem is that when indexinx occurs the, didOpen could be done after hover, codelens, etc since we do a didOpen in smart mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hover qute
Projects
None yet
Development

No branches or pull requests

2 participants