Commit f2a800c5 authored by Matija Obreza's avatar Matija Obreza

Merge branch '40-npe-in-springsecurityauditoraware' into 'master'

Resolve "NPE in SpringSecurityAuditorAware"

Closes #40

See merge request genesys-pgr/application-blocks!76
parents 48ecd31e 93c1065b
......@@ -124,7 +124,7 @@
<plugin>
<inherited>true</inherited>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<version>3.8.1</version>
<configuration>
<source>${jdk.source}</source>
<target>${jdk.target}</target>
......
......@@ -52,7 +52,7 @@ public class SpringSecurityAuditorAware implements AuditorAware<Long> {
if (principal instanceof AclSid) {
return Optional.of(((AclSid) principal).getId());
} else if (principal instanceof String) {
return Optional.of(aclService.getSidId((String) principal));
return Optional.ofNullable(aclService.getSidId((String) principal));
} else {
LOG.warn("Principal {} is not AclSid, but type {}. Auth of type {}", principal, principal.getClass(), authentication.getClass());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment