fix bug 145 ( https://www.argeo.org/bugzilla/show_bug.cgi?id=145 ).
authorBruno Sinou <bsinou@argeo.org>
Tue, 19 Mar 2013 14:39:38 +0000 (14:39 +0000)
committerBruno Sinou <bsinou@argeo.org>
Tue, 19 Mar 2013 14:39:38 +0000 (14:39 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@6167 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

base/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/ui/utils/CommandUtils.java

index e020ecf3e89316c9d7cb1913c886be20bb3ab226..8b7658626cfd0e60bca77ac99becb92909d1a071 100644 (file)
@@ -171,6 +171,8 @@ public class CommandUtils {
                        Command cmd = cmdService.getCommand(commandID);
 
                        ArrayList<Parameterization> parameters = null;
+                       ParameterizedCommand pc;
+
                        if (paramMap != null) {
                                // Set parameters of the command to launch :
                                parameters = new ArrayList<Parameterization>();
@@ -181,10 +183,12 @@ public class CommandUtils {
                                                        cmd.getParameter(id), paramMap.get(id));
                                        parameters.add(parameterization);
                                }
-                       }
-                       // build the parameterized command
-                       ParameterizedCommand pc = new ParameterizedCommand(cmd,
-                                       parameters.toArray(new Parameterization[parameters.size()]));
+                               pc = new ParameterizedCommand(cmd,
+                                               parameters.toArray(new Parameterization[parameters
+                                                               .size()]));
+                       } else
+                               pc = new ParameterizedCommand(cmd, null);
+
                        // execute the command
                        handlerService.executeCommand(pc, null);
                } catch (Exception e) {