[jbosstools-commits] JBoss Tools SVN: r43784 - trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Tue Sep 18 04:05:25 EDT 2012
Author: rob.stryker at jboss.com
Date: 2012-09-18 04:05:25 -0400 (Tue, 18 Sep 2012)
New Revision: 43784
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java
Log:
JBIDE-12563 npe bug
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java 2012-09-18 07:21:17 UTC (rev 43783)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java 2012-09-18 08:05:25 UTC (rev 43784)
@@ -156,11 +156,15 @@
private void switchListener(IStructuredSelection previousSelection, IStructuredSelection newSel) {
if( previousSelection != null ) {
- IServer s = (IServer)previousSelection.getFirstElement();
- s.removeServerListener(serverListener);
+ Object o = previousSelection.getFirstElement();
+ if( o instanceof IServer) {
+ ((IServer)o).removeServerListener(serverListener);
+ }
}
- IServer s2 = (IServer)newSel.getFirstElement();
- s2.addServerListener(serverListener);
+ Object newSel1 = newSel.getFirstElement();
+ if( newSel1 instanceof IServer) {
+ ((IServer)newSel1).addServerListener(serverListener);
+ }
}
public void perform(final IServer server) {
More information about the jbosstools-commits
mailing list