Improve JCR explorer
[lgpl/argeo-commons.git] / eclipse / runtime / org.argeo.eclipse.ui / src / main / java / org / argeo / eclipse / spring / SpringCommandHandler.java
index ce0521bda6b0033d7e6fb0e2c8f5b66d8703ae1c..ebabae1308e0b44de059adc31f482c6fe7bde516 100644 (file)
@@ -18,6 +18,7 @@ package org.argeo.eclipse.spring;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.argeo.ArgeoException;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.IHandler;
@@ -45,6 +46,9 @@ public class SpringCommandHandler implements IHandler {
                        // TODO: make it more flexible and robust
                        ApplicationContext applicationContext = ApplicationContextTracker
                                        .getApplicationContext(bundleSymbolicName);
+                       if (applicationContext == null)
+                               throw new ArgeoException("No application context found for "
+                                               + bundleSymbolicName);
 
                        // retrieve the command via its id
                        String beanName = event.getCommand().getId();