aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Descher2013-02-05 16:14:25 (EST)
committerPaul Webster2013-02-05 16:14:25 (EST)
commitaec2b9fa0f49ee496f8753407c924b13021893cd (patch)
tree1831badbfc7f905a241b5ab6e127f880a17b517d
parente99e241e00e118c5a949b684e638b1abb6949e63 (diff)
downloadeclipse.platform.ui-aec2b9fa0f49ee496f8753407c924b13021893cd.zip
eclipse.platform.ui-aec2b9fa0f49ee496f8753407c924b13021893cd.tar.gz
eclipse.platform.ui-aec2b9fa0f49ee496f8753407c924b13021893cd.tar.bz2
Bug 397677 - HandledToolItem in Toolbar without defined command and
tooltip leads to NPE
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java
index f6a599b..1eb70a6 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Joseph Carroll <jdsalingerjr@gmail.com> - Bug 385414 Contributing wizards to toolbar always displays icon and text
* Snjezana Peco <snjezana.peco@redhat.com> - Memory leaks in Juno when opening and closing XML Editor - http://bugs.eclipse.org/397909
+ * Marco Descher <marco@descher.at> - Bug 397677
******************************************************************************/
package org.eclipse.e4.ui.workbench.renderers.swt;
@@ -279,6 +280,8 @@ public class HandledContributionItem extends ContributionItem {
model = item;
setId(model.getElementId());
generateCommand();
+ if (model.getCommand() == null)
+ logger.error("Element " + model.getElementId() + " invalid, no command defined."); //$NON-NLS-1$ //$NON-NLS-2$
updateVisible();
}
@@ -558,7 +561,7 @@ public class HandledContributionItem extends ContributionItem {
parmCmd = model.getWbCommand();
}
- if (text == null) {
+ if (parmCmd != null && text == null) {
try {
text = parmCmd.getName();
} catch (NotDefinedException e) {