mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-2967 - added exists, null and empty checks to solve the problems
This commit is contained in:
@@ -1446,7 +1446,11 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
|
||||
if (entry.getEvent().equals("Create Person") && entry.getNodeRef() != null)
|
||||
{
|
||||
NodeRef nodeRef = entry.getNodeRef();
|
||||
String userName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME);
|
||||
String userName = null;
|
||||
if(nodeService.exists(nodeRef))
|
||||
{
|
||||
userName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME);
|
||||
}
|
||||
json.put("nodeName", userName == null ? "": userName);
|
||||
json.put("createPerson", true);
|
||||
}
|
||||
|
@@ -158,6 +158,10 @@ public class AuditLogGet extends BaseAuditRetrievalWebScript
|
||||
if( targetNode == null )
|
||||
{
|
||||
targetNode = filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
|
||||
if(targetNode == null)
|
||||
{
|
||||
throw new WebScriptException(Status.STATUS_NOT_FOUND, "The default RM site was not found");
|
||||
}
|
||||
}
|
||||
return AccessStatus.ALLOWED.equals(
|
||||
capabilityService.getCapabilityAccessState(targetNode, ACCESS_AUDIT_CAPABILITY));
|
||||
|
Reference in New Issue
Block a user