Fix possible NPE
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / CdmViewerContextMenu.java
index 59082ad86eb3fc3ffd822d0dbc0c24333f69b9c4..db59d464d01ba40ddfd6c14b3a10fdb4a4b783d1 100644 (file)
@@ -108,7 +108,12 @@ public class CdmViewerContextMenu extends CompoundContributionItem {
             }
             ParameterizedCommand parameterizedCommand = ParameterizedCommand.generateCommand(command, params);
             try {
-                handlerService.executeCommand(parameterizedCommand, null);
+                if(parameterizedCommand!=null){
+                    handlerService.executeCommand(parameterizedCommand, null);
+                }
+                else{
+                    handlerService.executeCommand(command.getId(), null);
+                }
             } catch (NotDefinedException nde) {
                 throw new RuntimeException("Could not find open command: " + command.getId());
             } catch (Exception exception) {