SvgViewer - IllegalArgumentException when plugin is disabled.

I have the SvgViewer installed but disabled via the SvgViewer
configuration panel.

I opened two projects in separate IDEA frames. When I close the second
project by clicking on the X I get an IllegalArgumentException in the
IDEA bad plugin pop up.

It does not happen if the plugin is enabled when I close the project.

Why is SvgViewer doing anything when it is supposed to be disabled?

Thanks,

Tim



Exception Stack Trace Message from console window:
-



ERROR - ellij.project.impl.ProjectImpl -
ERROR - ellij.project.impl.ProjectImpl - IntelliJ IDEA 4.5.1
Build #2235
ERROR - ellij.project.impl.ProjectImpl - JDK: 1.4.2_04
ERROR - ellij.project.impl.ProjectImpl - VM: Java HotSpot(TM)
Client VM
ERROR - ellij.project.impl.ProjectImpl - Vendor: Sun
Microsystems Inc.
ERROR - ellij.project.impl.ProjectImpl - OS: Windows XP
ERROR - ellij.project.impl.ProjectImpl -
java.lang.IllegalArgumentException: listener cannot be null
at
com.intellij.openapi.h.a.d.removeFileEditorManagerListener(d.java:447)
at
idea.plugin.svgviewer.controller.project.SvgViewerProjectComponent.unregisterToolWindow(SvgViewerProjectComponent.java:95
)
at
idea.plugin.svgviewer.controller.project.SvgViewerProjectComponent.projectClosed(SvgViewerProjectComponent.java:68)
at com.intellij.openapi.d.b.d.A(d.java:162)
at com.intellij.openapi.d.b.d.access$300(d.java:219)
at com.intellij.openapi.d.b.d$c_.projectClosed(d$c_.java:2)
at com.intellij.openapi.d.b.b$1.projectClosed(b$1.java:18)
at com.intellij.openapi.d.b.b.k(b.java:159)
at com.intellij.openapi.d.b.b.b(b.java:94)
at com.intellij.ide.n.f.b(f.java:47)
at com.intellij.openapi.wm.impl.q$0.run(q$0.java:1)
at com.intellij.openapi.b.b.d$b_.run(d$b_.java:3)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at com.intellij.ide.t.b(t.java:29)
at com.intellij.ide.t.a(t.java:105)
at com.intellij.ide.t.dispatchEvent(t.java:16)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

4 comments
Comment actions Permalink

Tim,

Looks like a problem with IDEA beta build 2235 (4.5.1RC1). The problem does not happen with 2233 (4.5).

Looks like UnregisterToolWindow is trying to invoke removeFileEditorManagerListener without first checking that a listener exists. SvgViewer has already removed this listener before unregistering the tool window:

public void unregisterToolWindow()
{
FileEditorManager.getInstance(_project).removeFileEditorManagerListener(_editorListener);
project.getProjectFile().getFileSystem().removeVirtualFileListener(fileListener);

if (isToolWindowRegistered())
ToolWindowManager.getInstance(_project).unregisterToolWindow(ID_TOOL_WINDOW); // <-- fails here
}




You might want to lodge a bug report with JetBrains.

Cheers,
Andrew

0
Comment actions Permalink

Sorry, I posted too soon...2235 has tightened up its checking.

I'll change svgviewer to only try to remove non-null listeners!
Cheers,
A.

0
Comment actions Permalink

Andrew Armstrong wrote:

SvgViewer 2.2.4 should fix the problem.
Cheers,
A.

Binary: http://plugins.intellij.net/plugins/view/?id=SvgViewer

Source: http://www.intellij.org/twiki/bin/view/Main/SvgViewer


Thanks, I'll check it out.

0

Please sign in to leave a comment.