You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2022/01/10 00:08:14 UTC

[directory-server] branch master updated: Fix for DIRSERVER-2359. WWe should check if the AttributeType is not null.

This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git


The following commit(s) were added to refs/heads/master by this push:
     new 3c53831  Fix for DIRSERVER-2359. WWe should check if the AttributeType is not null.
3c53831 is described below

commit 3c53831d603fddf8350b6f68b88a49426062310b
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Mon Jan 10 01:07:42 2022 +0100

    Fix for DIRSERVER-2359. WWe should check if the AttributeType is not
    null.
---
 .../core/partition/impl/btree/AbstractBTreePartition.java     | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java b/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
index 9164f1b..7efef7b 100644
--- a/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
+++ b/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
@@ -3272,7 +3272,13 @@ public abstract class AbstractBTreePartition extends AbstractPartition implement
     @Override
     public boolean hasUserIndexOn( AttributeType attributeType ) throws LdapException
     {
+        if ( attributeType == null )
+        {
+            return false;
+        }
+
         String oid = attributeType.getOid();
+
         return userIndices.containsKey( oid );
     }
 
@@ -3283,6 +3289,11 @@ public abstract class AbstractBTreePartition extends AbstractPartition implement
     @Override
     public boolean hasSystemIndexOn( AttributeType attributeType ) throws LdapException
     {
+        if ( attributeType == null )
+        {
+            return false;
+        }
+
         return systemIndices.containsKey( attributeType.getOid() );
     }