added a check for null resources in auditing interceptor

This commit is contained in:
lmds1 2014-12-12 17:29:07 -05:00
parent df05f00b80
commit 6fe4261daf
1 changed files with 8 additions and 0 deletions

View File

@ -114,6 +114,10 @@ public class AuditingInterceptor extends InterceptorAdapter {
log.debug("No auditing configured."); log.debug("No auditing configured.");
return true; return true;
} }
if(theResponseObject == null || theResponseObject.isEmpty()){
log.debug("No bundle to audit");
return true;
}
try{ try{
log.info("Auditing bundle: " + theResponseObject + " from request " + theRequestDetails); log.info("Auditing bundle: " + theResponseObject + " from request " + theRequestDetails);
SecurityEvent auditEvent = new SecurityEvent(); SecurityEvent auditEvent = new SecurityEvent();
@ -163,6 +167,10 @@ public class AuditingInterceptor extends InterceptorAdapter {
log.debug("No auditing configured."); log.debug("No auditing configured.");
return true; return true;
} }
if(theResponseObject == null){
log.debug("No object to audit");
return true;
}
try{ try{
log.info("Auditing resource: " + theResponseObject + " from request: " + theRequestDetails); log.info("Auditing resource: " + theResponseObject + " from request: " + theRequestDetails);
SecurityEvent auditEvent = new SecurityEvent(); SecurityEvent auditEvent = new SecurityEvent();