diff options
author | Paul Webster | 2010-06-08 18:25:12 +0000 |
---|---|---|
committer | Paul Webster | 2010-06-08 18:25:12 +0000 |
commit | ddf605057f197362270ef0968c1458c9f1b1b245 (patch) | |
tree | f8e14f491311c37985aab4aeda4dc920f51cda15 /bundles/org.eclipse.e4.core.commands | |
parent | 50a933c60a139b8f780c0a2816cbaba26b528006 (diff) | |
download | eclipse.platform.ui-ddf605057f197362270ef0968c1458c9f1b1b245.tar.gz eclipse.platform.ui-ddf605057f197362270ef0968c1458c9f1b1b245.tar.xz eclipse.platform.ui-ddf605057f197362270ef0968c1458c9f1b1b245.zip |
Bug 308094 - Representing popups for context menus
NPE guard in the command service
Diffstat (limited to 'bundles/org.eclipse.e4.core.commands')
-rw-r--r-- | bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java index 077f4d253cf..62096484f4e 100644 --- a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java +++ b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceImpl.java @@ -11,8 +11,6 @@ package org.eclipse.e4.core.commands.internal; -import org.eclipse.e4.core.contexts.IEclipseContext; - import java.util.Map; import javax.inject.Inject; import org.eclipse.core.commands.Category; @@ -21,6 +19,7 @@ import org.eclipse.core.commands.CommandManager; import org.eclipse.core.commands.IParameter; import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.e4.core.commands.ECommandService; +import org.eclipse.e4.core.contexts.IEclipseContext; /** * @@ -50,7 +49,11 @@ public class CommandServiceImpl implements ECommandService { * java.util.Map) */ public ParameterizedCommand createCommand(String id, Map parameters) { - return ParameterizedCommand.generateCommand(getCommand(id), parameters); + Command command = getCommand(id); + if (command == null) { + return null; + } + return ParameterizedCommand.generateCommand(command, parameters); } /* |