Project

General

Profile

« Previous | Next » 

Revision 3af5dbb6

Added by Patrick Plitzner about 5 years ago

ref #8011 Fix potential NPE

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/SearchController.java
76 76
    }
77 77

  
78 78
    private void createFilterButtons(Set<Facet> facets) {
79
        Map<String, List<Facet>> categoryToFacetsMap = new TreeMap<>((String o1, String o2)->o1.compareTo(o2));
79
        Map<String, List<Facet>> categoryToFacetsMap = new TreeMap<>();//(String o1, String o2)->o1.compareTo(o2));
80 80
        for (Facet facet : facets) {
81
            List<Facet> categoryFacets = categoryToFacetsMap.get(facet.getCategory());
81
            String category = facet.getCategory();
82
            if(category==null){
83
                category = "None";
84
            }
85
            List<Facet> categoryFacets = categoryToFacetsMap.get(category);
82 86
            if(categoryFacets==null){
83 87
                categoryFacets = new ArrayList<>();
84 88
            }
85 89
            categoryFacets.add(facet);
86
            categoryToFacetsMap.put(facet.getCategory(), categoryFacets);
90
            categoryToFacetsMap.put(category, categoryFacets);
87 91
        }
88 92
        for (Entry<String, List<Facet>> entry: categoryToFacetsMap.entrySet()) {
89 93
            String category = entry.getKey();

Also available in: Unified diff