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 104db0fcfa2..ebd8a28e549 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 @@ -339,7 +339,7 @@ private String getToolTipText(boolean attachKeybinding) { private String legacyActionLabelSupport(String text, ParameterizedCommand command) { - return java.util.Optional.of(command).map(ParameterizedCommand::getCommand).map(Command::getHandler) + return java.util.Optional.ofNullable(command).map(ParameterizedCommand::getCommand).map(Command::getHandler) .map(IHandler::getHandlerLabel).filter(Objects::nonNull).orElse(text); }