[Fix] Use certificate username, if firstname and lastname null

- but only for agent users
This commit is contained in:
Robert von Burg 2017-08-08 14:58:01 +02:00
parent f82d593261
commit 27b6beff03
1 changed files with 4 additions and 2 deletions

View File

@ -1225,8 +1225,10 @@ public abstract class AbstractTransaction implements StrolchTransaction {
audit.setId(StrolchAgent.getUniqueIdLong());
audit.setUsername(this.certificate.getUsername());
audit.setFirstname(this.certificate.getFirstname());
audit.setLastname(this.certificate.getLastname());
audit.setFirstname(this.certificate.getFirstname() == null ? this.certificate.getUsername()
: this.certificate.getFirstname());
audit.setLastname(this.certificate.getLastname() == null ? this.certificate.getUsername()
: this.certificate.getLastname());
audit.setDate(new Date());
audit.setElementType(elementType);