gshakhn/sonar-intellij-plugin

NPE while adding a Library to a module

Vampire opened this issue · 2 comments

Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(761,828),absolute(1101,955),button=1,modifiers=Button1,clickCount=1] on dialog0
java.lang.NullPointerException
    at org.sonar.ide.intellij.ui.SonarModuleConfiguration.apply(SonarModuleConfiguration.java:129)
    at com.intellij.openapi.roots.ui.configuration.ModuleConfigurableWrapper.apply(ModuleConfigurableWrapper.java:62)
    at com.intellij.openapi.roots.ui.configuration.ModuleEditor.apply(ModuleEditor.java:298)
    at com.intellij.openapi.roots.ui.configuration.ModulesConfigurator.apply(ModulesConfigurator.java:292)
    at com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable.apply(ModuleStructureConfigurable.java:367)
    at com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable.apply(ProjectStructureConfigurable.java:283)
    at com.intellij.openapi.options.ex.SingleConfigurableEditor.doOKAction(SingleConfigurableEditor.java:147)
    at com.intellij.openapi.ui.DialogWrapper$OkAction.doAction(DialogWrapper.java:1541)
    at com.intellij.openapi.ui.DialogWrapper$DialogWrapperAction.actionPerformed(DialogWrapper.java:1508)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6290)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6055)
    at java.awt.Container.processEvent(Container.java:2039)
    at java.awt.Component.dispatchEventImpl(Component.java:4653)
    at java.awt.Container.dispatchEventImpl(Container.java:2097)
    at java.awt.Component.dispatchEvent(Component.java:4481)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4236)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
    at java.awt.Container.dispatchEventImpl(Container.java:2083)
    at java.awt.Window.dispatchEventImpl(Window.java:2482)
    at java.awt.Component.dispatchEvent(Component.java:4481)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:648)
    at java.awt.EventQueue.access$000(EventQueue.java:84)
    at java.awt.EventQueue$1.run(EventQueue.java:607)
    at java.awt.EventQueue$1.run(EventQueue.java:605)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    at java.awt.EventQueue$2.run(EventQueue.java:621)
    at java.awt.EventQueue$2.run(EventQueue.java:619)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:618)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:699)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:534)
    at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:420)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
    at java.awt.Dialog$1.run(Dialog.java:1044)
    at java.awt.Dialog$3.run(Dialog.java:1096)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Dialog.show(Dialog.java:1094)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.a(DialogWrapperPeerImpl.java:742)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:738)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:426)
    at com.intellij.openapi.ui.DialogWrapper.showAndGetOk(DialogWrapper.java:1382)
    at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1367)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.a(ShowSettingsUtilImpl.java:238)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.editConfigurable(ShowSettingsUtilImpl.java:206)
    at com.intellij.ide.actions.ShowStructureSettingsAction.actionPerformed(ShowStructureSettingsAction.java:35)
    at com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:169)
    at com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:133)
    at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:310)
    at java.awt.Component.processEvent(Component.java:6055)
    at java.awt.Container.processEvent(Container.java:2039)
    at java.awt.Component.dispatchEventImpl(Component.java:4653)
    at java.awt.Container.dispatchEventImpl(Container.java:2097)
    at java.awt.Component.dispatchEvent(Component.java:4481)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4236)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
    at java.awt.Container.dispatchEventImpl(Container.java:2083)
    at java.awt.Window.dispatchEventImpl(Window.java:2482)
    at java.awt.Component.dispatchEvent(Component.java:4481)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:648)
    at java.awt.EventQueue.access$000(EventQueue.java:84)
    at java.awt.EventQueue$1.run(EventQueue.java:607)
    at java.awt.EventQueue$1.run(EventQueue.java:605)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    at java.awt.EventQueue$2.run(EventQueue.java:621)
    at java.awt.EventQueue$2.run(EventQueue.java:619)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:618)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:699)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:534)
    at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:420)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

This also bites me if I have not configured sonar for a project. I just created a new Project that is not in Sonar, but I cannot change the module configuration now because of the Sonar plugin :-(

Should be fixed with the commit above!