avoid NPE when reusing taxonname for taxon creation
authorKatja Luther <k.luther@bgbm.org>
Thu, 1 Dec 2016 08:14:09 +0000 (09:14 +0100)
committerKatja Luther <k.luther@bgbm.org>
Thu, 1 Dec 2016 08:14:09 +0000 (09:14 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java

index 5630820216a6c5dd0ab09bf68bbaf5fcf7075994..3f6849c959d573655b8c136e16561ff3b6a270f9 100644 (file)
@@ -285,9 +285,12 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                }
                if (taxonName != null){
                    taxon = Taxon.NewInstance(taxonName, secundum);
-                   if (!taxonName.getTitleCache().trim().equals(textNewTaxonName.getText().trim())){
-                       textNewTaxonName.setText(taxonName.getTitleCache());
+                   if (textNewTaxonName.getText() == null || !taxonName.getTitleCache().trim().equals(textNewTaxonName.getText().trim())){
+                        textNewTaxonName.setText(taxonName.getTitleCache());
                    }
+//                 if (!taxonName.getTitleCache().trim().equals(textNewTaxonName.getText().trim())){
+//                     textNewTaxonName.setText(taxonName.getTitleCache());
+//                 }
                } else {
                    textNewTaxonName.setText(null);
                }