Project

General

Profile

« Previous | Next » 

Revision a136d47b

Added by Andreas Kohlbecker almost 6 years ago

fixing NPE introcdued in caf42d50

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/component/common/PersonField.java
365 365
        super.commit();
366 366

  
367 367
        Person bean =  getValue();
368
        String nomTitle = nomenclaturalTitleField.getValue();
369
        if(nomTitle != null && nomTitle.equals(titleCacheField.getValue())){
370
            // no point having a nomenclaturalTitle if it is equal to the titleCache
371
            bean.setNomenclaturalTitle(null);
372
        }
368

  
373 369
        if(bean != null){
370
            String nomTitle = nomenclaturalTitleField.getValue();
371
            if(nomTitle != null && nomTitle.equals(titleCacheField.getValue())){
372
                // no point having a nomenclaturalTitle if it is equal to the titleCache
373
                bean.setNomenclaturalTitle(null);
374
            }
374 375
            boolean isUnsaved = bean.getId() == 0;
375 376
            if(isUnsaved && !(hasNullContent() && !allowNewEmptyEntity)){
376 377
                UserHelper.fromSession().createAuthorityForCurrentUser(bean, EnumSet.of(CRUD.UPDATE, CRUD.DELETE), null);

Also available in: Unified diff