String commandId = menuItem.getCommand().getElementId();
UUID uuid = (UUID) menuItem.getTransientData().get(commandId+".feature.uuid");
Feature feature = HibernateProxyHelper.deproxy(CdmStore.getService(ITermService.class).load(uuid), Feature.class);
- Object object = selection.getFirstElement();
+ Object object = null;
+ if (selection != null) {
+ object = selection.getFirstElement();
+ }
if (activePart.getObject() instanceof TaxonEditor && object == null) {
object = ((TaxonEditor)activePart.getObject()).getTaxon();
}
description = HibernateProxyHelper.deproxy(object, DescriptionBase.class);
}else if (object instanceof Taxon){
Taxon taxon = (Taxon) object;
- description =taxon.getDefaultDescription();
- }
+ description =taxon.getDefaultDescription();
+ }
if (description != null &&((description.isComputed() || description.isCloneForSource())&& PreferencesUtil.isComputedDesciptionHandlingDisabled())){
canExecute = false;