ref #10335 try to fix NPE when selecting no annotation type
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 8 Jun 2023 15:05:33 +0000 (17:05 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Thu, 8 Jun 2023 15:05:33 +0000 (17:05 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AnnotationDtoElement.java

index 2466b46f6f8fae1f814f3b3dda5ea226a758af7e..4cf90918b4a9d2f327778568458fe2d3a5d28704 100644 (file)
@@ -69,8 +69,8 @@ public class AnnotationDtoElement extends AbstractEntityCollectionElement<Annota
        @Override
        public void handleEvent(Object eventSource) {
                if(eventSource == combo_annotationType){
-                   getEntity().setTypeLabel(combo_annotationType.getSelection().getLabel());
-                   getEntity().setTypeUuid(combo_annotationType.getSelection().getUuid());
+                   getEntity().setTypeLabel(combo_annotationType.getSelection() == null ? null :combo_annotationType.getSelection().getLabel());
+                   getEntity().setTypeUuid(combo_annotationType.getSelection() == null ? null :combo_annotationType.getSelection().getUuid());
                }else if(eventSource == text){
                        getEntity().setText(text.getText());
                }