Project

General

Profile

Revision 5cfa24d5

ID5cfa24d5f545a265dd4ad21b4104bda0573978d8
Parent 948d9990
Child 4d76d7eb

Added by Fabian Reimeier almost 3 years ago

ref #6903 resolved NPE when loading classification from session

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/distributionStatus/AreaAndTaxonSettingsConfigWindow.java
92 92
        } catch (SQLException e) {
93 93
            DistributionEditorUtil.showSqlError(e);
94 94
        }
95
        RowId parent = null;
95
        RowId classificationRow = null;
96 96
        if(classification!=null){
97
        	parent = new RowId(classification.getRootNode().getId());
97
            classificationRow = new RowId(classification.getId());
98 98
        }
99 99
        else if(classificationBox.getItemIds().size()==1){
100 100
            //only one classification exists
101
            parent = (RowId) classificationBox.getItemIds().iterator().next();
101
            classificationRow = (RowId) classificationBox.getItemIds().iterator().next();
102 102
        }
103
        if(parent!=null){
104
            classificationBox.setValue(new RowId(parent.getId()));
105
            showClassificationTaxa(getUuidAndTitleCacheFromRowId(parent));
103
        if(classificationRow!=null){
104
            classificationBox.setValue(classificationRow);
105
            showClassificationTaxa(getUuidAndTitleCacheFromRowId(classificationRow));
106 106
        }
107 107

  
108 108
        classificationBox.addValueChangeListener(this);
......
300 300
        ((TaxonNodeContainer) taxonTree.getContainerDataSource()).addChildItems(parent);
301 301
    }
302 302

  
303
    private void showClassificationTaxa(UuidAndTitleCache<TaxonNode> parent) {
304
        final Collection<UuidAndTitleCache<TaxonNode>> children = CdmSpringContextHelper.getTaxonNodeService().listChildNodesAsUuidAndTitleCache(parent);
303
    private void showClassificationTaxa(UuidAndTitleCache<TaxonNode> rootNode) {
304
        final Collection<UuidAndTitleCache<TaxonNode>> children = CdmSpringContextHelper.getTaxonNodeService().listChildNodesAsUuidAndTitleCache(rootNode);
305 305
        // Enable polling and set frequency to 0.5 seconds
306 306
        UI.getCurrent().setPollInterval(500);
307 307
        taxonTree.setEnabled(false);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)