From a6a65fc0d6eea12237a81e8c769eb30acc30b6f5 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Mon, 12 Dec 2011 16:34:46 +0000
Subject: [PATCH] Fix OPENDJ-384: Substring search on entryUUID fails with a NullPointerException attributes may return null for substring syntaxes. That wasn't checked in the "optimization path" for initial substrings.

---
 opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java b/opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java
index be3911a..0c52b6b 100644
--- a/opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java
+++ b/opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java
@@ -1289,7 +1289,7 @@
       if (filter.getSubInitialElement() != null)
       {
         // Use the equality index for initial substrings if possible.
-        if (equalityIndex != null)
+        if ((equalityIndex != null) && (matchRule != null))
         {
           ByteString normValue =
                matchRule.normalizeSubstring(filter.getSubInitialElement());

--
Gitblit v1.10.0