Merge branch 'release/5.28.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / media / MediaRepresentationElement.java
index e77f33a1bb020e52c977a1caf97b76e35d27185b..a91a8d4c570b240d1795cfc8bbe8145e094cf23d 100644 (file)
@@ -59,14 +59,19 @@ public class MediaRepresentationElement extends AbstractEntityCollectionElement<
                text_suffix = formFactory.createTextWithLabelElement(element, "Suffix", null, style);
                section_mediaRepresentationPart = formFactory.createMediaRepresentationPartSection(getConversationHolder(), element, StoreUtil.getSectionStyle(MediaRepresentationPartSection.class, MediaRepresentation.class.getCanonicalName()));
                section_mediaRepresentationPart.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+               if (entity != null){
+                       setEntity(entity);
+               }
        }
 
        @Override
        public void setEntity(MediaRepresentation element) {
                this.entity = element;
-               section_mediaRepresentationPart.setEntity(element);
-               text_mimeType.setText(element.getMimeType());
-               text_suffix.setText(element.getSuffix());
+               if (section_mediaRepresentationPart != null){
+                       section_mediaRepresentationPart.setEntity(element);
+                       text_mimeType.setText(element.getMimeType());
+                       text_suffix.setText(element.getSuffix());
+               }
        }
 
        @Override