Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

75702: Merged DEV to HEAD-BUG-FIX (5.0/Cloud)
      75532: ACE-2133 : LDAP logging throws NullPointerException
      Added additional checks to avoid NPE while closing the contexts.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@77540 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2014-07-22 13:43:36 +00:00
parent 97db4de531
commit 915c6a916b

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2013 Alfresco Software Limited.
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -992,14 +992,21 @@ public class LDAPUserRegistry implements UserRegistry, LDAPNameResolver, Initial
String name = result.getNameInNamespace();
// Close the contexts, see ALF-20682
((Context)result.getObject()).close();
Context context = (Context) result.getObject();
if (context != null)
{
context.close();
}
result = null;
return name;
}
// Close the contexts, see ALF-20682
((Context)result.getObject()).close();
Context context = (Context) result.getObject();
if (context != null)
{
context.close();
}
result = null;
}
@@ -1025,7 +1032,11 @@ public class LDAPUserRegistry implements UserRegistry, LDAPNameResolver, Initial
{
try
{
((Context)result.getObject()).close();
Context context = (Context) result.getObject();
if (context != null)
{
context.close();
}
}
catch (Exception e)
{