directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1202269 - /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/
Date Tue, 15 Nov 2011 16:11:46 GMT
Author: elecharny
Date: Tue Nov 15 16:11:46 2011
New Revision: 1202269

URL: http://svn.apache.org/viewvc?rev=1202269&view=rev
Log:
Protected the constructors against a NPE when the session is null

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/CompareOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/DeleteOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/GetRootDseOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/HasEntryOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ListOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveAndRenameOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/RenameOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/SearchOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/UnbindOperationContext.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/CompareOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/CompareOperationContext.java?rev=1202269&r1=1202268&r2=1202269&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/CompareOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/CompareOperationContext.java
Tue Nov 15 16:11:46 2011
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ * 
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ * 
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.core.api.interceptor.context;
 
@@ -58,7 +58,11 @@ public class CompareOperationContext ext
     public CompareOperationContext( CoreSession session )
     {
         super( session );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+        }
     }
 
     
@@ -70,7 +74,11 @@ public class CompareOperationContext ext
     public CompareOperationContext( CoreSession session, Dn dn )
     {
         super( session, dn );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+        }
     }
 
     
@@ -83,7 +91,11 @@ public class CompareOperationContext ext
     {
         super( session );
         this.oid = oid;
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+        }
     }
 
     
@@ -96,7 +108,11 @@ public class CompareOperationContext ext
     {
         super( session, dn );
         this.oid = oid;
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+        }
     }
 
     
@@ -110,7 +126,11 @@ public class CompareOperationContext ext
         super( session, dn );
         this.oid = oid;
         this.value = value;
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+        }
     }
 
     
@@ -120,7 +140,11 @@ public class CompareOperationContext ext
         this.oid = compareRequest.getAttributeId();
         this.value = compareRequest.getAssertionValue();
         this.requestControls = compareRequest.getControls();
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.COMPARE
) );
+        }
         
         if ( requestControls.containsKey( ManageDsaIT.OID ) )
         {
@@ -136,7 +160,7 @@ public class CompareOperationContext ext
     /**
      * @return The compared OID
      */
-    public String getOid() 
+    public String getOid()
     {
         return oid;
     }
@@ -146,7 +170,7 @@ public class CompareOperationContext ext
      * Set the compared OID
      * @param oid The compared OID
      */
-    public void setOid( String  oid ) 
+    public void setOid( String  oid )
     {
         this.oid = oid;
     }
@@ -155,7 +179,7 @@ public class CompareOperationContext ext
     /**
      * @return The value to compare
      */
-    public Value<?> getValue() 
+    public Value<?> getValue()
     {
         return value;
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/DeleteOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/DeleteOperationContext.java?rev=1202269&r1=1202268&r2=1202269&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/DeleteOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/DeleteOperationContext.java
Tue Nov 15 16:11:46 2011
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ * 
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ * 
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.core.api.interceptor.context;
 
@@ -43,7 +43,11 @@ public class DeleteOperationContext exte
     public DeleteOperationContext( CoreSession session )
     {
         super( session );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE
) );
+        }
     }
     
 
@@ -55,14 +59,23 @@ public class DeleteOperationContext exte
     public DeleteOperationContext( CoreSession session, Dn deleteDn )
     {
         super( session, deleteDn );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE
) );
+        }
     }
 
 
     public DeleteOperationContext( CoreSession session, DeleteRequest deleteRequest )
     {
         super( session, deleteRequest.getName() );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE
) );
+        }
+        
         requestControls = deleteRequest.getControls();
         
         if ( requestControls.containsKey( ManageDsaIT.OID ) )

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/GetRootDseOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/GetRootDseOperationContext.java?rev=1202269&r1=1202268&r2=1202269&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/GetRootDseOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/GetRootDseOperationContext.java
Tue Nov 15 16:11:46 2011
@@ -39,7 +39,11 @@ public class GetRootDseOperationContext 
     public GetRootDseOperationContext( CoreSession session )
     {
         super( session );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.GET_ROOT_DSE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.GET_ROOT_DSE
) );
+        }
     }
     
     
@@ -51,7 +55,11 @@ public class GetRootDseOperationContext 
     public GetRootDseOperationContext( CoreSession session, Dn dn )
     {
         super( session, dn );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.GET_ROOT_DSE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.GET_ROOT_DSE
) );
+        }
     }
     
     

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/HasEntryOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/HasEntryOperationContext.java?rev=1202269&r1=1202268&r2=1202269&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/HasEntryOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/HasEntryOperationContext.java
Tue Nov 15 16:11:46 2011
@@ -40,7 +40,11 @@ public class HasEntryOperationContext ex
     public HasEntryOperationContext( CoreSession session )
     {
         super( session );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.HAS_ENTRY
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.HAS_ENTRY
) );
+        }
     }
     
     
@@ -52,7 +56,11 @@ public class HasEntryOperationContext ex
     public HasEntryOperationContext( CoreSession session, Dn entryDn )
     {
         super( session, entryDn );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.HAS_ENTRY
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.HAS_ENTRY
) );
+        }
     }
     
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ListOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ListOperationContext.java?rev=1202269&r1=1202268&r2=1202269&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ListOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ListOperationContext.java
Tue Nov 15 16:11:46 2011
@@ -42,7 +42,11 @@ public class ListOperationContext extend
     public ListOperationContext( CoreSession session )
     {
         super( session );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.LIST
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.LIST
) );
+        }
     }
 
 
@@ -54,7 +58,11 @@ public class ListOperationContext extend
     public ListOperationContext( CoreSession session, Dn dn )
     {
         super( session, dn );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.LIST
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.LIST
) );
+        }
     }
 
 
@@ -69,7 +77,11 @@ public class ListOperationContext extend
     public ListOperationContext( CoreSession session, Dn dn, Set<AttributeTypeOptions>
returningAttributes )
     {
         super( session, dn, returningAttributes );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.LIST
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.LIST
) );
+        }
     }
 
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveAndRenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveAndRenameOperationContext.java?rev=1202269&r1=1202268&r2=1202269&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveAndRenameOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveAndRenameOperationContext.java
Tue Nov 15 16:11:46 2011
@@ -47,7 +47,11 @@ public class MoveAndRenameOperationConte
     public MoveAndRenameOperationContext( CoreSession session )
     {
         super( session );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE_AND_RENAME
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE_AND_RENAME
) );
+        }
     }
 
 
@@ -63,7 +67,11 @@ public class MoveAndRenameOperationConte
     {
         super( session, oldDn, newRdn, delOldRdn );
         this.newSuperiorDn = newSuperiorDn;
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE_AND_RENAME
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE_AND_RENAME
) );
+        }
 
         try
         {
@@ -81,7 +89,11 @@ public class MoveAndRenameOperationConte
         // super sets the newRdn and the delOldRdn members and tests
         super( session, modifyDnRequest );
         this.newSuperiorDn = modifyDnRequest.getNewSuperior();
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE_AND_RENAME
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE_AND_RENAME
) );
+        }
 
         if ( newSuperiorDn == null )
         {

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveOperationContext.java?rev=1202269&r1=1202268&r2=1202269&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveOperationContext.java
Tue Nov 15 16:11:46 2011
@@ -58,7 +58,11 @@ public class MoveOperationContext extend
     public MoveOperationContext( CoreSession session )
     {
         super( session );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE
) );
+        }
     }
 
 
@@ -71,7 +75,11 @@ public class MoveOperationContext extend
         this.newSuperior = newSuperior;
         oldSuperior = oldDn.getParent();
         rdn = ( oldDn.getRdn().clone() );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE
) );
+        }
 
         try
         {
@@ -88,7 +96,11 @@ public class MoveOperationContext extend
     {
         super( session, modifyDnRequest.getName() );
         this.newSuperior = modifyDnRequest.getNewSuperior();
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE
) );
+        }
 
         if ( newSuperior == null )
         {

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/RenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/RenameOperationContext.java?rev=1202269&r1=1202268&r2=1202269&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/RenameOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/RenameOperationContext.java
Tue Nov 15 16:11:46 2011
@@ -55,7 +55,11 @@ public class RenameOperationContext exte
     public RenameOperationContext( CoreSession session )
     {
         super( session );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.RENAME
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.RENAME
) );
+        }
     }
 
 
@@ -71,7 +75,11 @@ public class RenameOperationContext exte
         super( session, oldDn );
         this.newRdn = newRdn;
         this.deleteOldRdn = deleteOldRdn;
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.RENAME
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.RENAME
) );
+        }
     }
 
 
@@ -79,7 +87,11 @@ public class RenameOperationContext exte
     {
         super( session, modifyDnRequest.getName() );
         this.newRdn = modifyDnRequest.getNewRdn();
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.RENAME
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.RENAME
) );
+        }
 
         if ( newRdn == null )
         {

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/SearchOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/SearchOperationContext.java?rev=1202269&r1=1202268&r2=1202269&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/SearchOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/SearchOperationContext.java
Tue Nov 15 16:11:46 2011
@@ -58,7 +58,11 @@ public class SearchOperationContext exte
     public SearchOperationContext( CoreSession session )
     {
         super( session );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.SEARCH
) );
+        
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.SEARCH
) );
+        }
     }
 
 
@@ -69,7 +73,11 @@ public class SearchOperationContext exte
     public SearchOperationContext( CoreSession session, SearchRequest searchRequest ) throws
LdapException
     {
         super( session );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.SEARCH
) );
+        
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.SEARCH
) );
+        }
 
         this.dn = searchRequest.getBase();
         this.filter = searchRequest.getFilter();
@@ -114,7 +122,11 @@ public class SearchOperationContext exte
         timeLimit = searchControls.getTimeLimit();
         sizeLimit = searchControls.getCountLimit();
         typesOnly = searchControls.getReturningObjFlag();
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.SEARCH
) );
+        
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.SEARCH
) );
+        }
 
         if ( searchControls.getReturningAttributes() != null )
         {
@@ -143,7 +155,11 @@ public class SearchOperationContext exte
         super( session, dn, returningAttributes );
         super.setScope( scope );
         this.filter = filter;
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.SEARCH
) );
+        
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.SEARCH
) );
+        }
     }
 
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/UnbindOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/UnbindOperationContext.java?rev=1202269&r1=1202268&r2=1202269&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/UnbindOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/UnbindOperationContext.java
Tue Nov 15 16:11:46 2011
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ * 
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ * 
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.core.api.interceptor.context;
 
@@ -40,7 +40,11 @@ public class UnbindOperationContext exte
     public UnbindOperationContext( CoreSession session )
     {
         super( session, session.getEffectivePrincipal().getDn() );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.UNBIND
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.UNBIND
) );
+        }
     }
     
 
@@ -48,7 +52,11 @@ public class UnbindOperationContext exte
     {
         super( session, session.getEffectivePrincipal().getDn() );
         setRequestControls( unbindRequest.getControls() );
-        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.UNBIND
) );
+
+        if ( session != null )
+        {
+            setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.UNBIND
) );
+        }
     }
 
     



Mime
View raw message