Project

General

Profile

« Previous | Next » 

Revision 74bcae9a

Added by Patrick Plitzner about 8 years ago

Add null checks

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportClassification.java
110 110
        //Checkliste
111 111
        TaxonBase taxonBaseCL = state.getRelatedObject(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, String.valueOf(id), TaxonBase.class);
112 112
        Taxon parentCL = (Taxon) state.getRelatedObject(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, parentId, TaxonBase.class);
113
        if(taxonBaseCL!=null && parentCL!=null){//null check necessary because not all taxa exist in the checklist
113
        if(taxonBaseCL!=null){//null check necessary because not all taxa exist in the checklist
114 114
            createParentChildNodes(checklistClassification, id, gueltString, taxZusatzString, taxonBaseCL, parentCL);
115 115
        }
116 116
    }
......
119 119
            String taxZusatzString, TaxonBase taxonBase, Taxon parent) {
120 120
        if(parent==null){
121 121
            RedListUtil.logMessage(id, "parent taxon of "+taxonBase+"  is null." , logger);
122
            return;
122 123
        }
123 124
        if(taxonBase==null){
124 125
            RedListUtil.logMessage(id, "child taxon/synonym of "+parent+"  is null." , logger);
126
            return;
125 127
        }
126 128
        //taxon
127 129
        if(taxonBase.isInstanceOf(Taxon.class)){

Also available in: Unified diff