NPE in SonarLint for IntelliJ 4.12.0.22340

This error happens when I try commiting code to my Git repo:

2020-10-02 10:09:09,334 [1923019]   INFO - ntellij.analysis.SonarLintTask - Running SonarLint Analysis for 3 files 
2020-10-02 10:09:09,981 [1923666]   WARN - ntellij.analysis.SonarLintTask - Error running SonarLint analysis 
java.lang.NullPointerException
	at org.sonarlint.intellij.core.AnalysisRequirementNotifications.lambda$notifyOnceForSkippedPlugins$0(AnalysisRequirementNotifications.java:64)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1632)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
	at org.sonarlint.intellij.core.AnalysisRequirementNotifications.lambda$notifyOnceForSkippedPlugins$2(AnalysisRequirementNotifications.java:64)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.sonarlint.intellij.core.AnalysisRequirementNotifications.notifyOnceForSkippedPlugins(AnalysisRequirementNotifications.java:63)
	at org.sonarlint.intellij.core.ConnectedSonarLintFacade.analyze(ConnectedSonarLintFacade.java:74)
	at org.sonarlint.intellij.core.SonarLintFacade.startAnalysis(SonarLintFacade.java:62)
	at org.sonarlint.intellij.analysis.SonarLintAnalyzer.analyzeModule(SonarLintAnalyzer.java:88)
	at org.sonarlint.intellij.analysis.SonarLintTask.analyze(SonarLintTask.java:187)
	at org.sonarlint.intellij.analysis.SonarLintTask.run(SonarLintTask.java:103)
	at org.sonarlint.intellij.analysis.SonarLintUserTask.run(SonarLintUserTask.java:38)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:962)
	at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:520)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:80)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:236)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:236)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	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.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:834)

This prevents the IDE from committing files, I have to disable Perform SonarLint analysis to check in my code.

This started happening right after I updated to SonarLint 4.12.0.22340

IntelliJ IDEA 2020.3 EAP (Ultimate Edition)
Build #IU-203.4203.26, built on September 30, 2020
IntelliJ IDEA EAP User
Expiration date: October 30, 2020
Runtime version: 11.0.8+10-b1098.1 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 12
Registry: debugger.watches.in.variables=false
Non-Bundled Plugins: PlantUML integration, Lombook Plugin, YourKit Java Profiler 2019.8-b137 Integration, org.sonarlint.idea, MavenRunHelper, com.dmarcotte.handlebars

It looks like attemptedLanguages contains a null value:

I have the same error when trying to analyze a groovy file

Hi folks,

Thanks for reporting this issue, and sorry for the inconvenience. I have a fix in progress, you can track progress here:

For the time being, going back to 4.11 or earlier version works fine.

Or if you want to help validating the fix, this is the staged artifact Iā€™m about to release: https://repox.jfrog.io/repox/sonarsource/org/sonarsource/sonarlint/intellij/sonarlint-intellij/4.12.1.22375/sonarlint-intellij-4.12.1.22375.zip

Let me know how it goes.

Bugfix version 4.12.1 has been published on the marketplace.

Thanks again for reporting it so quickly.

1 Like

Thank you for the prompt fix :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.