Revision f2e93f2c
Added by Cherian Mathew over 7 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailElement.java | ||
---|---|---|
97 | 97 |
public void setEntity(T entity) { |
98 | 98 |
this.entity = entity; |
99 | 99 |
// the id is always 0 if the entity was not yet saved, so it is new in this case |
100 |
if(StoreUtil.getCdmEntity(getEntity()).getId() == 0) { |
|
100 |
if(getEntity() == null || StoreUtil.getCdmEntity(getEntity()).getId() == 0) {
|
|
101 | 101 |
// new entity, not yet saved |
102 | 102 |
requiredCrud = EnumSet.of(CRUD.CREATE); |
103 | 103 |
} else { |
Also available in: Unified diff
added check for entity being null