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

Various fixes in Maven Property Code Actions #438

Merged

Conversation

vrubezhny
Copy link
Contributor

  • Fix NPE in DOMUtils.findElementText
  • Fix InlineInlinePropertyCodeAction.rangeContains

When running Lemminx-Maven on VSCode (using vscode-xml extension) a following NPE may happen:

```
Message: Cannot invoke "org.eclipse.lemminx.dom.DOMElement.getChildren()" because "element" is null
java.lang.NullPointerException: Cannot invoke "org.eclipse.lemminx.dom.DOMElement.getChildren()" because "element" is null
	at org.eclipse.lemminx.extensions.maven.utils.DOMUtils.findElementText(DOMUtils.java:97)
	at org.eclipse.lemminx.extensions.maven.utils.ParticipantUtils.getMavenProperty(ParticipantUtils.java:302)
	at org.eclipse.lemminx.extensions.maven.participants.codeaction.InlinePropertyCodeAction.doCodeActionUnconditional(InlinePropertyCodeAction.java:55)
	at org.eclipse.lemminx.services.XMLCodeActions.doCodeActions(XMLCodeActions.java:81)
	at org.eclipse.lemminx.services.XMLLanguageService.doCodeActions(XMLLanguageService.java:284)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$codeAction$24(XMLTextDocumentService.java:502)
	at org.eclipse.lemminx.commons.ModelTextDocuments.lambda$computeModelAsync$0(ModelTextDocuments.java:118)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	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)
```
@vrubezhny vrubezhny merged commit 7e60345 into eclipse-lemminx:master Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant