REPO-2516 - MNT-17845: Added a null check on the noderef

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@137796 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2017-06-25 15:05:22 +00:00
parent f10fa934f5
commit c9806ab898

View File

@@ -115,6 +115,8 @@ public class Reference
* *
*/ */
public static final Reference fromNodeRef(NodeRef nodeRef) public static final Reference fromNodeRef(NodeRef nodeRef)
{
if (nodeRef != null)
{ {
String id = nodeRef.getId(); String id = nodeRef.getId();
if (id.startsWith("" + VIRTUAL_TOKEN) && (id.length() > 1)) // belts-and-braces if (id.startsWith("" + VIRTUAL_TOKEN) && (id.length() > 1)) // belts-and-braces
@@ -143,7 +145,7 @@ public class Reference
logger.debug("Encoding exception:", ree); logger.debug("Encoding exception:", ree);
return null; return null;
} }
}
} }
} }
return null; return null;