Error in SonarLint for IntelliJ: "Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null"

Environment:

  • Java version=11.0.5
  • Java vendor=JetBrains s.r.o
  • OS name=Linux
  • OS architecture=amd64
  • IDE=IntelliJ IDEA 2019.3.3
  • SonarLint version=4.5.0.15320
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'module' of com/intellij/openapi/roots/ModuleRootManager.getInstance must not be null
	at com.intellij.openapi.roots.ModuleRootManager.$$$reportNull$$$0(ModuleRootManager.java)
	at com.intellij.openapi.roots.ModuleRootManager.getInstance(ModuleRootManager.java)
	at org.sonarlint.intellij.util.SonarLintUtils.getSourceFolder(SonarLintUtils.java:193)
	at org.sonarlint.intellij.analysis.LocalFileExclusions.checkFileInSourceFolders(LocalFileExclusions.java:145)
	at org.sonarlint.intellij.analysis.LocalFileExclusions.checkExclusions(LocalFileExclusions.java:119)
	at org.sonarlint.intellij.ui.AutoTriggerStatusPanel.getCard(AutoTriggerStatusPanel.java:119)
	at org.sonarlint.intellij.ui.AutoTriggerStatusPanel.switchCards(AutoTriggerStatusPanel.java:107)
	at org.sonarlint.intellij.ui.AutoTriggerStatusPanel.access$000(AutoTriggerStatusPanel.java:58)
	at org.sonarlint.intellij.ui.AutoTriggerStatusPanel$2.selectionChanged(AutoTriggerStatusPanel.java:101)
	at jdk.internal.reflect.GeneratedMethodAccessor101.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 com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:513)
	at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:142)
	at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:438)
	at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:398)
	at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:388)
	at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:372)
	at com.intellij.util.messages.impl.MessageBusImpl.lambda$createTopicHandler$1(MessageBusImpl.java:241)
	at com.sun.proxy.$Proxy103.selectionChanged(Unknown Source)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$fireSelectionChanged$21(FileEditorManagerImpl.java:1576)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$6$1.run(FileEditorManagerImpl.java:1019)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$3(FocusManagerImpl.java:168)
	at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2418)
	at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:177)
	at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:129)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:159)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:165)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$null$2(FocusManagerImpl.java:173)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:309)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:441)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)

Hi,

Thanks for reporting this issue. I think it is similar to https://jira.sonarsource.com/browse/SLI-377. We will publish a fix very soon.

1 Like