public boolean canExecute(IEclipseContext popupContext, @Named(IServiceConstants.ACTIVE_SELECTION) ISelection selection) {
@SuppressWarnings("unchecked")
Collection<IElement> elements = (Collection<IElement>) popupContext.get(SetFocusableDynamicMenuContribution.FOCUSABLE_ELEMENTS);
- return !elements.isEmpty();
+ return elements != null && !elements.isEmpty();
}
@Execute