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 during Qute validation when project is not available #886

Closed
angelozerr opened this issue Jun 14, 2023 · 0 comments · Fixed by #887
Closed

NPE during Qute validation when project is not available #886

angelozerr opened this issue Jun 14, 2023 · 0 comments · Fixed by #887
Assignees
Labels
bug Something isn't working qute validation
Milestone

Comments

@angelozerr
Copy link
Contributor

When validation is triggered for Qute template (ex : a classpath changed is done) and the Qute project is not ready, there is the following NPE:

SEVERE: Error while validating expression '"Qute"' in 'file:///C:/Users/azerr/git/code-with-quarkus/src/main/resources/templates/page.qute.html'.
java.lang.NullPointerException
	at com.redhat.qute.services.QuteDiagnostics.validateExpression(QuteDiagnostics.java:560)
	at com.redhat.qute.services.QuteDiagnostics.validateMethodPart(QuteDiagnostics.java:973)
	at com.redhat.qute.services.QuteDiagnostics.validateMemberPart(QuteDiagnostics.java:819)
	at com.redhat.qute.services.QuteDiagnostics.validateExpressionParts(QuteDiagnostics.java:645)
	at com.redhat.qute.services.QuteDiagnostics.validateExpression(QuteDiagnostics.java:573)
	at com.redhat.qute.services.QuteDiagnostics.validateDataModel(QuteDiagnostics.java:310)
	at com.redhat.qute.services.QuteDiagnostics.doDiagnostics(QuteDiagnostics.java:196)
	at com.redhat.qute.services.QuteLanguageService.doDiagnostics(QuteLanguageService.java:161)
	at com.redhat.qute.ls.template.TemplateFileTextDocumentService.triggerValidationFor(TemplateFileTextDocumentService.java:388)
	at com.redhat.qute.ls.template.TemplateFileTextDocumentService.lambda$validateAllTemplates$26(TemplateFileTextDocumentService.java:424)
	at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1693)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
	at com.redhat.qute.ls.template.TemplateFileTextDocumentService.validateAllTemplates(TemplateFileTextDocumentService.java:423)
	at com.redhat.qute.ls.template.TemplateFileTextDocumentService.dataModelChanged(TemplateFileTextDocumentService.java:373)
	at com.redhat.qute.ls.QuteTextDocumentService.dataModelChanged(QuteTextDocumentService.java:310)
	at com.redhat.qute.ls.QuteLanguageServer.dataModelChanged(QuteLanguageServer.java:299)
	at jdk.internal.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at com.redhat.qute.ls.commons.ParentProcessWatcher.lambda$apply$0(ParentProcessWatcher.java:148)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

@angelozerr angelozerr added bug Something isn't working validation qute labels Jun 14, 2023
@angelozerr angelozerr self-assigned this Jun 14, 2023
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Jun 14, 2023
@angelozerr angelozerr added this to the 0.15.0 milestone Jun 14, 2023
fbricon pushed a commit that referenced this issue Jun 14, 2023
Fixes #886

Signed-off-by: azerr <azerr@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working qute validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant