import org.eclipse.swt.widgets.Composite;
import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.model.term.TermType;
import eu.etaxonomy.cdm.persistence.dto.TermDto;
import eu.etaxonomy.taxeditor.store.CdmStore;
@Override
protected List<TermSearchResult> searchResults(String searchString){
List<TermSearchResult> searchResults = new ArrayList<>();
- Collection<TermDto> dtos = CdmStore.getService(ITermService.class).findByTitleAsDto(searchString, termType);
- dtos.stream().forEach(dto->searchResults.add(new TermSearchResult(dto)));
+ if(CdmUtils.isNotBlank(searchString)){
+ Collection<TermDto> dtos = CdmStore.getService(ITermService.class).findByTitleAsDto(searchString, termType);
+ dtos.stream().forEach(dto->searchResults.add(new TermSearchResult(dto)));
+ }
return searchResults;
}